Line 166 | Line 166 |
---|
if ($this->query_result === false) {
|
if ($this->query_result === false) {
|
if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false)
| try { $this->query_result = @odbc_exec($this->db_connect_id, $query); } catch (\Error $e) { // Do nothing as SQL driver will report the error }
if ($this->query_result === false)
|
{ $this->sql_error($query); }
| { $this->sql_error($query); }
|
Line 184 | Line 193 |
---|
{ return false; }
|
{ return false; }
|
| $safe_query_id = $this->clean_query_id($this->query_result);
|
if ($cache && $cache_ttl) {
|
if ($cache && $cache_ttl) {
|
$this->open_queries[(int) $this->query_result] = $this->query_result;
| $this->open_queries[$safe_query_id] = $this->query_result;
|
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0) {
|
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl); } else if (strpos($query, 'SELECT') === 0) {
|
$this->open_queries[(int) $this->query_result] = $this->query_result;
| $this->open_queries[$safe_query_id] = $this->query_result;
|
} } else if ($this->debug_sql_explain)
| } } else if ($this->debug_sql_explain)
|
Line 260 | Line 271 |
---|
$query_id = $this->query_result; }
|
$query_id = $this->query_result; }
|
if ($cache && $cache->sql_exists($query_id))
| $safe_query_id = $this->clean_query_id($query_id); if ($cache && $cache->sql_exists($safe_query_id))
|
{
|
{
|
return $cache->sql_fetchrow($query_id);
| return $cache->sql_fetchrow($safe_query_id);
|
}
return ($query_id) ? odbc_fetch_array($query_id) : false; }
/**
|
}
return ($query_id) ? odbc_fetch_array($query_id) : false; }
/**
|
* {@inheritDoc}
| * {@inheritdoc}
|
*/
|
*/
|
function sql_nextid()
| public function sql_last_inserted_id()
|
{ $result_id = @odbc_exec($this->db_connect_id, 'SELECT @@IDENTITY');
| { $result_id = @odbc_exec($this->db_connect_id, 'SELECT @@IDENTITY');
|
Line 301 | Line 313 |
---|
$query_id = $this->query_result; }
|
$query_id = $this->query_result; }
|
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
| $safe_query_id = $this->clean_query_id($query_id); if ($cache && $cache->sql_exists($safe_query_id))
|
{
|
{
|
return $cache->sql_freeresult($query_id);
| return $cache->sql_freeresult($safe_query_id);
|
}
|
}
|
if (isset($this->open_queries[(int) $query_id]))
| if (isset($this->open_queries[$safe_query_id]))
|
{
|
{
|
unset($this->open_queries[(int) $query_id]);
| unset($this->open_queries[$safe_query_id]);
|
return odbc_free_result($query_id); }
| return odbc_free_result($query_id); }
|