return addslashes($str);
}
}
+
// SELECT query string from table, columns and so on... ;-)
function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) {
+ // Is columns an array?
+ if (!is_array($columns) {
+ // No array
+ trigger_error(sprintf("columns is not array. %s!=array", gettype($columns)));
+ }
+
// Prepare the SQL statement
- $SQL = "SELECT ".implode(", ", $columns)." FROM "._MYSQL_PREFIX."_".$table." WHERE ".$idRow."=%s LIMIT 1";
+ $SQL = "SELECT `".implode("`, `", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1";
// Return the result
- return SQL_QUERY_ESC($SQL, array(bigintval($id)), $F, $L);
+ return SQL_QUERY_ESC($SQL,
+ array(
+ bigintval($id),
+ $table,
+ $idRow
+ ), $F, $L);
}
+
// ALTER TABLE wrapper function
function SQL_ALTER_TABLE ($sql, $F, $L) {
// This is the default result...