donate: use mysqli
authorGrant Slater <git@firefishy.com>
Wed, 15 Feb 2017 15:14:21 +0000 (15:14 +0000)
committerGrant Slater <git@firefishy.com>
Wed, 15 Feb 2017 15:15:35 +0000 (15:15 +0000)
cookbooks/donate/templates/default/db-connect.inc.php.erb

index ce05bc9..c437acb 100644 (file)
@@ -1,4 +1,6 @@
 <?php
-$_DB_H = mysql_connect('localhost','donate','<%= @passwords['database'] %>');
-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->query('SET NAMES \'utf8\'');