From e448066176d46b7ff80295e579e5304f78398061 Mon Sep 17 00:00:00 2001 From: Ayham Al-Ali Date: Wed, 25 Jan 2023 20:47:52 +0300 Subject: [PATCH] Fix DB Prefix --- read.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/read.php b/read.php index eac1ab0..f13e48d 100644 --- a/read.php +++ b/read.php @@ -11,14 +11,16 @@ include 'qrcode/config/config.php'; +$prefix = DATABASE_PREFIX; + //Get DB instance. function is defined in config.php $db = getDbInstance(); $get_id = htmlspecialchars($_GET['id'], ENT_QUOTES, 'UTF-8'); // I take the id through the GET method -$state = $db->query("SELECT state FROM dynamic_qrcodes WHERE identifier='$get_id'"); -$link = $db->query("SELECT link FROM dynamic_qrcodes WHERE identifier='$get_id'"); +$state = $db->query("SELECT state FROM " . $prefix . "dynamic_qrcodes WHERE identifier='$get_id'"); +$link = $db->query("SELECT link FROM " . $prefix . "dynamic_qrcodes WHERE identifier='$get_id'"); -$update = $db->query("UPDATE dynamic_qrcodes SET scan=scan+1 WHERE identifier='$get_id'"); +$update = $db->query("UPDATE " . $prefix . "dynamic_qrcodes SET scan=scan+1 WHERE identifier='$get_id'"); if($state[0]['state'] == 'enable'){ echo ''; // Page refresh with the link obtained