opps, added missing curly braces

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-05-16 17:54:45 +02:00
parent f4a33ed3f0
commit 79d524a9ad
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -279,14 +279,13 @@ function dbesc($str) {
return(str_replace("'","\\'",$str)); return(str_replace("'","\\'",$str));
}} }}
// Function: q($sql,$args);
// Description: execute SQL query with printf style args.
// Example: $r = q("SELECT * FROM `%s` WHERE `uid` = %d",
// 'user', 1);
if (! function_exists('q')) { if (! function_exists('q')) {
/**
* Function: q($sql,$args);
* Description: execute SQL query with printf style args.
* Example: $r = q("SELECT * FROM `%s` WHERE `uid` = %d",
* 'user', 1);
*/
function q($sql) { function q($sql) {
global $db; global $db;
@ -296,8 +295,9 @@ function q($sql) {
if ($db && $db->connected) { if ($db && $db->connected) {
$stmt = @vsprintf($sql,$args); // Disabled warnings $stmt = @vsprintf($sql,$args); // Disabled warnings
//logger("dba: q: $stmt", LOGGER_ALL); //logger("dba: q: $stmt", LOGGER_ALL);
if ($stmt === false) if ($stmt === false) {
logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG); logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG);
}
return $db->q($stmt); return $db->q($stmt);
} }