X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fpool-functions.php;h=1bfc33bfc48411f2ff0bfe8ac99942f7977b45b3;hp=7927a0329a01dac5cdcebdeeb5251e482f660656;hb=155492a5b96cec674846973a8524238b0365a848;hpb=da5c63bacddced77a951cbe7b223f314885a6c87 diff --git a/inc/pool-functions.php b/inc/pool-functions.php index 7927a0329a..1bfc33bfc4 100644 --- a/inc/pool-functions.php +++ b/inc/pool-functions.php @@ -47,7 +47,7 @@ function getPoolDataFromId ($poolId) { $content = array(); // Search for pool data - $result = SQL_QUERY_ESC('SELECT + $result = sqlQueryEscaped('SELECT `id`, `sender`, `subject`, @@ -68,13 +68,13 @@ LIMIT 1', array(bigintval($poolId)), __FUNCTION__, __LINE__); // Is there an entry? - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Load data - $content = SQL_FETCHARRAY($result); + $content = sqlFetchArray($result); } // END - if // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); // Return found data return $content; @@ -88,7 +88,7 @@ function updatePoolDataById ($poolId, $columnName, $data, $updateMode = NULL, $w assert(!is_array($data)); // Then use this on the column with this mode (mostly counters) - SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_pool` SET `%s`=`%s`%s%s WHERE `id`=%s' . $whereSql . ' LIMIT 1', + sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_pool` SET `%s`=`%s`%s%s WHERE `id`=%s' . $whereSql . ' LIMIT 1', array( $columnName, $columnName, @@ -104,17 +104,17 @@ function updatePoolDataById ($poolId, $columnName, $data, $updateMode = NULL, $w $sql = 'UPDATE `{?_MYSQL_PREFIX?}_pool` SET '; foreach ($data as $key => $value) { // Add it - $sql .= sprintf("`%s`='%s',", SQL_ESCAPE($key), SQL_ESCAPE($value)); + $sql .= sprintf("`%s`='%s',", sqlEscapeString($key), sqlEscapeString($value)); } // END - foreach // Finish SQL $sql = substr($sql, 0, -1) . $moreSql . ' WHERE `id`=' . bigintval($id) . $whereSql . ' LIMIT 1'; // And finally run it - SQL_QUERY($sql, __FUNCTION__, __LINE__); + sqlQuery($sql, __FUNCTION__, __LINE__); } else { // Regular update - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `%s`='%s' WHERE `id`=%s" . $whereSql . ' LIMIT 1', + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `%s`='%s' WHERE `id`=%s" . $whereSql . ' LIMIT 1', array( $columnName, $data, @@ -123,7 +123,7 @@ function updatePoolDataById ($poolId, $columnName, $data, $updateMode = NULL, $w } // Return if it has an affected row - return (SQL_AFFECTEDROWS() == 1); + return (sqlAffectedRows() == 1); } // Insert data into pool and return its insert id @@ -132,10 +132,10 @@ function insertDataIntoPool ($data) { $sql = 'INSERT INTO `{?_MYSQL_PREFIX?}_pool (`' . implode('`,`', array_map('SQL_ESCAPE', array_keys($data))) . "`) VALUES ('" . implode("','", array_values($data)) . "')"; // Run the query - SQL_QUERY($sql, __FUNCTION__, __LINE__); + sqlQuery($sql, __FUNCTION__, __LINE__); // Return insert id - return SQL_INSERT_ID(); + return getSqlInsertId(); } // [EOF]