Inconsistency between echo and print() fixed to OUTPUT_HTML() (not all)
[mailer.git] / inc / db / lib-mysql3.php
index 0d97094c82d13cc01ddc966b90450e57e7fd62cf..bb43adeba8f2a3ed8142c5862bb582938c6f6642 100644 (file)
@@ -70,12 +70,12 @@ function SQL_QUERY ($sql_string, $F, $L) {
        $querytimeBefore = array_sum(explode(' ', microtime()));
 
        // Run SQL command
-       //* DEBUG: */ print $sql_string."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML($sql_string."<br />");
        $result = mysql_query($sql_string, SQL_GET_LINK())
                or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
 Query string:<br />
 ".$sql_string);
-       //* DEBUG: */ print __LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />");
 
        // Ending time
        $querytimeAfter = array_sum(explode(' ', microtime()));
@@ -90,7 +90,7 @@ Query string:<br />
        incrementConfigEntry('sql_count');
 
        // Debug output
-       //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
+       //* DEBUG: */ OUTPUT_HTML("Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />");
        if ((getOutputMode() != '1') && (getOutputMode() != '-1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) {
                //
                // Debugging stuff...
@@ -222,7 +222,7 @@ function SQL_CLOSE ($F, $L) {
        } // END - if
 
        // Do we need to update cache/db counter?
-       //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
+       //* DEBUG: */ OUTPUT_HTML("DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />");
        if ((GET_EXT_VERSION('cache') >= '0.0.7') && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (isCacheInstanceValid())) {
                // Add new hits
                incrementConfigEntry('db_hits', getConfig('db_hits_run'));
@@ -326,7 +326,7 @@ function SQL_ESCAPE ($str, $secureString=true, $strip=true) {
                return smartAddSlashes($str);
        } elseif (function_exists('mysql_real_escape_string')) {
                // The new and improved version
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):str={$str}<br />");
                return mysql_real_escape_string($str, SQL_GET_LINK());
        } elseif (function_exists('mysql_escape_string')) {
                // The obsolete function
@@ -391,7 +391,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // 123           4       4     3    3      4           4          32    23           4       4     3    3      4            4          321
                if (((SQL_NUMROWS($result) == 0) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
                        // Do the query
-                       //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
        } elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) {
@@ -408,11 +408,11 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                        while (strpos($columnName, ',') !== false) {
                                // Use last
                                $columnName = str_replace('`', '', $tableArray[count($tableArray) - $begin]);
-                               //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."<br />");
 
                                // Remove brackes
                                $columnName = str_replace('(', '', str_replace(')', '', $columnName));
-                               //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
+                               //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$columnName."----------------".$begin."<br />");
 
                                // Continue
                                $begin++;
@@ -427,7 +427,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                $skip = false;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Is it found?
-                       //* DEBUG: */ print "<pre>".print_r($content, true)."</pre>";
+                       //* DEBUG: */ OUTPUT_HTML("<pre>".print_r($content, true)."</pre>");
                        if (($content['Column_name'] == $columnName) || ($content['Key_name'] == $columnName)) {
                                // Skip this query!
                                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Skiped: %s", $sql));
@@ -442,12 +442,12 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // Shall we run it?
                if (!$skip) {
                        // Send it to the SQL_QUERY() function
-                       //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+                       //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
        } else {
                // Other ALTER TABLE query
-               //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__LINE__.':'.$sql."<br />");
                $result = SQL_QUERY($sql, $F, $L, false);
        }