* =============== Last change: 08/29/2004 *
* *
* -------------------------------------------------------------------- *
- * File : lib.php *
+ * File : lib-mysql3.php *
* -------------------------------------------------------------------- *
- * Short description : *
+ * Short description : Database layer for MySQL +3.x server *
* -------------------------------------------------------------------- *
- * Kurzbeschreibung : *
+ * Kurzbeschreibung : Datenbankschicht fuer MySQL +3.x Server *
* -------------------------------------------------------------------- *
* *
* -------------------------------------------------------------------- *
$querytimeBefore = array_sum(explode(' ', microtime()));
// Run SQL command
+ //* DEBUG: */ echo $sql_string."<br />\n";
$result = @mysql_query($sql_string, $link)
or ADD_FATAL($F." (".$L."):".mysql_error()."<br />
".MYSQL_QUERY_STRING."<br />
// SQL string escaping
function SQL_QUERY_ESC($qstring, $data, $file, $line, $run=true, $strip=true) {
global $link;
+ $query = "";
$eval = "\$query = sprintf(\"".$qstring."\"";
foreach ($data as $var) {
if ((!empty($var)) || ($var === 0)) {
//
// Debugging
//
- //$fp = fopen(PATH."escape_debug.log", 'a') or mxchange_die("Cannot write debug.log!");
- //fwrite($fp, $file."(".$line."): ".str_replace('\r', "", str_replace('\n', " ", $eval))."\n");
+ //$fp = fopen(PATH."inc/cache/escape_debug.log", 'a') or mxchange_die("Cannot write debug.log!");
+ //fwrite($fp, $file."(".$line."): ".str_replace("\r", "", str_replace("\n", " ", $eval))."\n");
//fclose($fp);
- eval($eval);
+ @eval($eval);
+ if (empty($query)) {
+ print "eval=".htmlentities($eval)."<pre>";
+ debug_print_backtrace();
+ die("</pre>");
+ }
if ($run) {
// Run SQL query (default)
return SQL_QUERY($query, $file, $line);