Adding of network advert types partly finished, hard-coded table type fixed to dynamic
[mailer.git] / inc / db / lib-mysql3.php
index 8ed21c3218340cb79142db44896e4dbb535793b6..ab53b7041b94b2a85a1aff213e561a91bb5aa69b 100644 (file)
@@ -71,14 +71,18 @@ function SQL_QUERY ($sqlString, $F, $L) {
        // Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
        $sqlString = str_replace("\t", ' ', str_replace("\n", ' ', str_replace("\r", ' ', $sqlString)));
 
-       // Compile config out
-       $sqlString = FILTER_COMPILE_CONFIG($sqlString, true);
+       // Replace {PER}
+       $sqlString = str_replace('{PER}', '%', $sqlString);
+
+       // Compile config entries out
+       $eval = "\$sqlString = \"".FILTER_COMPILE_CONFIG(escapeQuotes($sqlString))."\";";
+       eval($eval);
 
        // Starting time
        $querytimeBefore = microtime(true);
 
        // Run SQL command
-       //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . $sqlString . '<br />');
+       //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '<br />');
        $result = mysql_query($sqlString, SQL_GET_LINK())
                or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):' . mysql_error() . '<br />
 Query string:<br />