]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/donate/templates/default/db-connect.inc.php.erb
donate: disable mysql strict mode
[chef.git] / cookbooks / donate / templates / default / db-connect.inc.php.erb
index b2d2a6f5e4b82650463f46edf755575122784660..c4cea1f935a30c1a369fdad68123fab895bb0f36 100644 (file)
@@ -1,4 +1,8 @@
 <?php
-$_DB_H = mysql_connect('localhost','donate','<%= @database_password %>');
-mysql_select_db('donate', $_DB_H);
-mysql_query('SET NAMES \'utf8\'', $_DB_H);
+$_DB_H = new mysqli('localhost','donate','<%= @passwords['database'] %>','donate');
+if ($_DB_H->connect_errno) {
+    die('DB Connect Error: ' . $_DB_H->connect_errno);
+}
+$_DB_H->report_mode = MYSQLI_REPORT_ERROR;
+$_DB_H->query('set @@sql_mode = \'\'');
+$_DB_H->query('SET NAMES \'utf8\'');