* $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 *
$content = array();
// Search for pool data
- $result = SQL_QUERY_ESC('SELECT
+ $result = sqlQueryEscaped('SELECT
`id`,
`sender`,
`subject`,
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;
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,
$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,
}
// Return if it has an affected row
- return (SQL_AFFECTEDROWS() == 1);
+ return (sqlAffectedRows() == 1);
}
// Insert data into pool and return its insert id
$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]