Merge pull request #484 from laf/issue-483

Updated the way debug=yes in url works to make it visually more appealing
This commit is contained in:
Daniel Preussker
2015-03-01 18:46:47 +01:00
4 changed files with 137 additions and 19 deletions

View File

@@ -22,10 +22,14 @@ Usage
* Used by the other _query functions.
* */
function dbQuery($sql, $parameters = array()) {
global $fullSql, $debug;
global $fullSql, $debug, $sql_debug;
$fullSql = dbMakeQuery($sql, $parameters);
if($debug) {
print Console_Color::convert("\nSQL[%y".$fullSql."%n] ");
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
print Console_Color::convert("\nSQL[%y".$fullSql."%n] ");
} else {
$sql_debug[] = $fullSql;
}
#echo("\nSQL[".$fullSql."] ");
}