mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +09:00
Improve error handling in MySQL/MySQLi DB drivers
This commit is contained in:
parent
5b5c785b19
commit
770644d114
2 changed files with 7 additions and 3 deletions
|
|
@ -1063,7 +1063,11 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function convertEncodingStr($str)
|
public static function convertEncodingStr($str)
|
||||||
{
|
{
|
||||||
if(!$str) return null;
|
if (!$str || utf8_check($str))
|
||||||
|
{
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
|
||||||
$obj = new stdClass;
|
$obj = new stdClass;
|
||||||
$obj->str = $str;
|
$obj->str = $str;
|
||||||
$obj = self::convertEncoding($obj);
|
$obj = self::convertEncoding($obj);
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,8 @@ class DBMysqli extends DBMysql
|
||||||
{
|
{
|
||||||
if ($connection === null)
|
if ($connection === null)
|
||||||
{
|
{
|
||||||
debug_print_backtrace();
|
$this->setError(-1, 'Unable to connect to DB.');
|
||||||
exit;
|
return false;
|
||||||
}
|
}
|
||||||
if($this->use_prepared_statements == 'Y')
|
if($this->use_prepared_statements == 'Y')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue