Move to utf8mb4 and add php7 mysql compat shim

fixes #10, #35, #36 (hopefully)
This commit is contained in:
Xkeeper
2017-07-18 22:32:51 -07:00
parent fd7990a262
commit 58ea368c45
2 changed files with 841 additions and 1 deletions

View File

@@ -1,4 +1,10 @@
<?php
if (!function_exists("mysql_connect")) {
// probably php 7, load shim for it
require_once("lib/mysql_compat.php");
}
class mysql {
// a 'backport' of my 'static' class in not-as-static form
// the statistics remain static so they're global just in case this gets used for >1 connection
@@ -22,7 +28,7 @@
$this->connection = (($persist) ? mysql_pconnect($host,$user,$pass) : mysql_connect($host,$user,$pass));
$t = microtime(true)-$start;
$this->id = ++self::$connection_count;
$this->set_character_encoding("utf8");
$this->set_character_encoding("utf8mb4");
if (self::$debug_on) {
$b = self::getbacktrace();