Inconsistency of using DATABASE_PREFIX with getOne()
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ if($_SESSION['type'] !== 'super') {
|
|||||||
$db->where("id_owner", $_SESSION['user_id']);
|
$db->where("id_owner", $_SESSION['user_id']);
|
||||||
$db->orWhere ("id_owner", NULL, 'IS');
|
$db->orWhere ("id_owner", NULL, 'IS');
|
||||||
}
|
}
|
||||||
$numScan = $db->getOne(DATABASE_PREFIX."dynamic_qrcodes", "sum(scan) as numScan");
|
$numScan = $db->getOne("dynamic_qrcodes", "sum(scan) as numScan");
|
||||||
|
|
||||||
/* CREATED CHART */
|
/* CREATED CHART */
|
||||||
//I initialize the variables that will contain the daily values to 0 otherwise in the foreach loop they will be reset every time
|
//I initialize the variables that will contain the daily values to 0 otherwise in the foreach loop they will be reset every time
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Users
|
|||||||
$db = getDbInstance();
|
$db = getDbInstance();
|
||||||
|
|
||||||
$db->where('id', $id);
|
$db->where('id', $id);
|
||||||
$result = $db->getOne(DATABASE_PREFIX.'users');
|
$result = $db->getOne('users');
|
||||||
|
|
||||||
if($result !== NULL)
|
if($result !== NULL)
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ if($_SERVER["REQUEST_METHOD"] !== "GET" || !isset($_GET['id']))
|
|||||||
$db = getDbInstance();
|
$db = getDbInstance();
|
||||||
|
|
||||||
$db->where("identifier", $_GET['id']);
|
$db->where("identifier", $_GET['id']);
|
||||||
$qrcode = $db->getOne(DATABASE_PREFIX."dynamic_qrcodes");
|
$qrcode = $db->getOne("dynamic_qrcodes");
|
||||||
|
|
||||||
$data = array (
|
$data = array (
|
||||||
'scan' => $db->inc(1)
|
'scan' => $db->inc(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user