X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fsql-functions.php;h=9982711f408a4783d574b449493c67ef4ef11d80;hb=c575a24a33f26e98ab6a34dbfc3ab1e520fe7312;hp=fae901b2733c39f2ef10059e8474e31e79648685;hpb=798d1b4557e774a74b7d8e3795dad2a46532b592;p=mailer.git diff --git a/inc/sql-functions.php b/inc/sql-functions.php index fae901b273..9982711f40 100644 --- a/inc/sql-functions.php +++ b/inc/sql-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -42,10 +42,11 @@ if (!defined('__SECURITY')) { // Init SQLs array function initSqls () { - setSqlsArray(array()); + // Init generic array + setSqlsArray(array('generic' => array())); } -// Checks wether the sqls array is initialized +// Checks whether the sqls array is initialized function isSqlsInitialized () { return ((isset($GLOBALS['sqls'])) && (is_array($GLOBALS['sqls']))); } @@ -69,7 +70,7 @@ function getSqls () { // Add an SQL to the list function addSql ($sql) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("sql=%s, count=%d", $sql, countSqls())); - $GLOBALS['sqls']['generic'][] = (string) $sql; + array_push($GLOBALS['sqls']['generic'], $sql); } // Merge SQLs together @@ -112,7 +113,7 @@ function countSqls () { return $count; } -// Checks wether the SQLs array is filled +// Checks whether the SQLs array is filled function isSqlsValid () { //* DEBUG: */ debugOutput(__FUNCTION__ . ':' . intval(isSqlsInitialized()) . '/' . countSqls() . '/' . getCurrentExtensionName()); return ( @@ -206,7 +207,7 @@ function getInsertSqlFromArray ($array, $tableName) { $SQL .= sprintf('%01.5f', $value); } else { // Everything else might be a string, so add ticks around it - $SQL .= "'" . SQL_ESCAPE($value) . "',"; + $SQL .= chr(39) . SQL_ESCAPE($value) . chr(39) . ','; } } // END - foreach