Commit a82e1fe2 authored by Dries's avatar Dries

- Patch #212918 by chx: fixed SQL queries on mysqli.

parent ffdbe06e
......@@ -81,6 +81,8 @@ function db_connect($url) {
// Force UTF-8.
mysqli_query($connection, 'SET NAMES "utf8"');
// Require ANSI mode to improve SQL portability.
mysqli_query($connection, "SET SESSION sql_mode='ANSI'");
return $connection;
}
......@@ -120,8 +122,6 @@ function _db_query($query, $debug = 0) {
}
if (!mysqli_errno($active_db)) {
// Require ANSI mode to improve SQL portability.
mysqli_query($active_db, "SET SESSION sql_mode='ANSI'");
return $result;
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment