use PDOException;
use PDOStatement;
-require_once 'include/dba.php';
-
/**
* @class MySQL database class
*
* @param string $query The database query that will be analyzed
*/
private static function logIndex($query) {
- $a = get_app();
+ $a = \get_app();
if (!$a->getConfigVariable('system', 'db_log_index')) {
return;
* @return bool|object statement object or result object
*/
public static function p($sql) {
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
* @return boolean Was the query successfull? False is returned only if an error occurred
*/
public static function e($sql) {
- $a = get_app();
+ $a = \get_app();
$stamp = microtime(true);
* @return array current row
*/
public static function fetch($stmt) {
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
foreach ($old_fields AS $fieldname => $content) {
if (isset($fields[$fieldname])) {
- if ($fields[$fieldname] == $content) {
+ if (($fields[$fieldname] == $content) && !is_null($content)) {
unset($fields[$fieldname]);
} else {
$do_update = true;
* @return boolean was the close successful?
*/
public static function close($stmt) {
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);