Line 155 | Line 155 |
---|
switch ($status) { case 'begin':
|
switch ($status) { case 'begin':
|
return @mysqli_autocommit($this->db_connect_id, false);
| @mysqli_autocommit($this->db_connect_id, false); $result = @mysqli_begin_transaction($this->db_connect_id); return $result;
|
break;
case 'commit':
| break;
case 'commit':
|
Line 197 | Line 199 |
---|
if ($this->query_result === false) {
|
if ($this->query_result === false) {
|
if (($this->query_result = @mysqli_query($this->db_connect_id, $query)) === false)
| try { $this->query_result = @mysqli_query($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 254 | Line 265 |
---|
$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_fetchrow($query_id);
| return $cache->sql_fetchrow($safe_query_id);
|
}
if ($query_id)
| }
if ($query_id)
|
Line 280 | Line 292 |
---|
$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_rowseek($rownum, $query_id);
| return $cache->sql_rowseek($rownum, $safe_query_id);
|
}
return ($query_id) ? @mysqli_data_seek($query_id, $rownum) : false; }
/**
|
}
return ($query_id) ? @mysqli_data_seek($query_id, $rownum) : false; }
/**
|
* {@inheritDoc}
| * {@inheritdoc}
|
*/
|
*/
|
function sql_nextid()
| public function sql_last_inserted_id()
|
{ return ($this->db_connect_id) ? @mysqli_insert_id($this->db_connect_id) : false; }
| { return ($this->db_connect_id) ? @mysqli_insert_id($this->db_connect_id) : false; }
|
Line 308 | Line 321 |
---|
$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 (!$query_id)
| }
if (!$query_id)
|
Line 342 | Line 356 |
---|
{ if ($this->db_connect_id) {
|
{ if ($this->db_connect_id) {
|
$error = array( 'message' => @mysqli_error($this->db_connect_id), 'code' => @mysqli_errno($this->db_connect_id) );
| $error = [ 'message' => $this->db_connect_id->error, 'code' => $this->db_connect_id->errno, ];
|
} else if (function_exists('mysqli_connect_error')) {
|
} else if (function_exists('mysqli_connect_error')) {
|
$error = array( 'message' => @mysqli_connect_error(), 'code' => @mysqli_connect_errno(), );
| $error = [ 'message' => $this->db_connect_id->connect_error, 'code' => $this->db_connect_id->connect_errno, ];
|
} else {
|
} else {
|
$error = array(
| $error = [
|
'message' => $this->connect_error, 'code' => '',
|
'message' => $this->connect_error, 'code' => '',
|
);
| ];
|
}
return $error;
| }
return $error;
|