From 7b4b4231dbd8bf04f969e21a5c7c824bbd50435c Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 29 Aug 2012 17:55:57 +0200 Subject: [PATCH] Make the PDO object cast nulls to empty strings to work around PHP retardedness --- include.mysql.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include.mysql.php b/include.mysql.php index 44ea944..d014e32 100644 --- a/include.mysql.php +++ b/include.mysql.php @@ -45,6 +45,7 @@ if(!empty($cphp_config->database->driver)) try { $database = new CachedPDO("mysql:host={$cphp_config->database->hostname};dbname={$cphp_config->database->database}", $cphp_config->database->username, $cphp_config->database->password); + $database->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_TO_STRING); $cphp_mysql_connected = true; } catch (Exception $e)