]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use mysqli_set_charset instead of set names
authorEvan Prodromou <evan@controlyourself.ca>
Sat, 30 May 2009 16:20:42 +0000 (12:20 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Sat, 30 May 2009 16:20:42 +0000 (12:20 -0400)
scripts/fixup_utf8.php

index 67f9c46236b9af1482012fbd58401adf8f6f78b3..925da24844517f231f3ea82e90f01ede132c26ad 100644 (file)
@@ -121,10 +121,14 @@ function doConnect($charset)
         return NULL;
     }
 
-    $result = $db->query("SET NAMES $charset");
+//    $result = $db->query("SET NAMES $charset");
 
-    if (PEAR::isError($result)) {
-        echo "ERROR: " . $result->getMessage() . "\n";
+    $conn = $db->connection;
+
+    $succ = mysqli_set_charset($conn, $charset);
+
+    if (!$succ) {
+        echo "ERROR: couldn't set charset\n";
         $db->disconnect();
         return NULL;
     }