X-Git-Url: https://projects.mako.cc/source/scuttle/blobdiff_plain/c20b44263a89d8bf1a78bfa632daaae3cb4f1da2..53ed2435e2c70b9ab7e76a2c21c444641bd97977:/includes/db/mysqli.php diff --git a/includes/db/mysqli.php b/includes/db/mysqli.php index fa643c2..d2eaa9b 100644 --- a/includes/db/mysqli.php +++ b/includes/db/mysqli.php @@ -46,6 +46,8 @@ class sql_db { if (@mysqli_select_db($this->db_connect_id, $this->dbname)) { + //Set utf-8 + mysqli_query($this->db_connect_id, 'SET CHARACTER SET utf8'); return $this->db_connect_id; } } @@ -310,7 +312,7 @@ class sql_db if ($rownum > -1) { @mysqli_data_seek($query_id, $rownum); - $row = @mysqli_fetch_assoc($query_id); + $row = @mysqli_fetch_row($query_id); $result = isset($row[$field]) ? $row[$field] : false; } else @@ -380,10 +382,10 @@ class sql_db } function sql_escape($msg) { - if (function_exists('mysql_real_escape_string')) { - return @mysql_real_escape_string($msg, $this->db_connect_id); + if (function_exists('mysqli_real_escape_string')) { + return @mysqli_real_escape_string($this->db_connect_id, $msg); } else { - return mysql_escape_string($msg); + return mysqli_escape_string($this->db_connect_id, $msg); } } @@ -400,7 +402,7 @@ class sql_db { $this->sql_transaction('rollback'); } - + trigger_error($message, E_USER_ERROR); }