]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool-functions.php
Support all extensions in link, too
[mailer.git] / inc / pool-functions.php
index b183001d23e4c50a2e92dda1dced98d9d6f4ad6a..1bfc33bfc48411f2ff0bfe8ac99942f7977b45b3 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -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]