} // END - if
// Count DB hits
- if (getConfig('db_hits_run') == null) {
+ if (!isConfigEntrySet('db_hits_run')) {
// Count in dummy variable
setConfigEntry('db_hits_run', 1);
} else {
}
// SQL num rows
-function SQL_NUMROWS($result) {
+function SQL_NUMROWS ($result) {
// Is the result a valid resource?
if (is_resource($result)) {
// Get the count of rows from database
// Was the eval() command fine?
if ($query == "failed") {
// Something went wrong?
- print "eval=".htmlentities($eval)."<pre>";
- debug_print_backtrace();
- die("</pre>");
+ printf("eval=%s\n<pre>%s</pre>",
+ htmlentities($eval),
+ debug_get_printable_backtrace()
+ );
+
+ // Abort further code executions
+ exit;
} // END - if
if ($run) {
// 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) {
+ if (!is_array($columns)) {
// No array
trigger_error(sprintf("columns is not array. %s!=array", gettype($columns)));
- }
+ } // END - if
// Prepare the SQL statement
$SQL = "SELECT `".implode("`, `", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1";
array($tableName, $columnName), $F, $L);
// Do we have no entry on ADD or an entry on DROP?
+ // 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321
if (((SQL_NUMROWS($result) == 0) && (eregi("ADD", $sql) > 0)) || ((SQL_NUMROWS($result) == 1) && (eregi("DROP", $sql) > 0))) {
// Do the query
$result = SQL_QUERY($sql, $F, $L, false);