From 225633ac1de99503c33eb2e020ceaa4abcc5180d Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 16 Dec 2012 22:55:50 +0100 Subject: [PATCH] Use PDO syntax for class queries --- frontend/classes/node.php | 4 ++-- frontend/classes/template.php | 4 ++-- frontend/classes/vps.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/classes/node.php b/frontend/classes/node.php index 14ca457..dd5e954 100644 --- a/frontend/classes/node.php +++ b/frontend/classes/node.php @@ -16,8 +16,8 @@ if(!isset($_CVM)) { die("Unauthorized."); } class Node extends CPHPDatabaseRecordClass { public $table_name = "nodes"; - public $fill_query = "SELECT * FROM nodes WHERE `Id` = '%d'"; - public $verify_query = "SELECT * FROM nodes WHERE `Id` = '%d'"; + public $fill_query = "SELECT * FROM nodes WHERE `Id` = :Id"; + public $verify_query = "SELECT * FROM nodes WHERE `Id` = :Id"; public $prototype = array( 'string' => array( diff --git a/frontend/classes/template.php b/frontend/classes/template.php index 22876b6..6973c26 100644 --- a/frontend/classes/template.php +++ b/frontend/classes/template.php @@ -16,8 +16,8 @@ if(!isset($_CVM)) { die("Unauthorized."); } class Template extends CPHPDatabaseRecordClass { public $table_name = "templates"; - public $fill_query = "SELECT * FROM templates WHERE `Id` = '%d'"; - public $verify_query = "SELECT * FROM templates WHERE `Id` = '%d'"; + public $fill_query = "SELECT * FROM templates WHERE `Id` = :Id"; + public $verify_query = "SELECT * FROM templates WHERE `Id` = :Id"; public $prototype = array( 'string' => array( diff --git a/frontend/classes/vps.php b/frontend/classes/vps.php index e97c423..f2c00e4 100644 --- a/frontend/classes/vps.php +++ b/frontend/classes/vps.php @@ -16,8 +16,8 @@ if(!isset($_CVM)) { die("Unauthorized."); } class Vps extends CPHPDatabaseRecordClass { public $table_name = "containers"; - public $fill_query = "SELECT * FROM containers WHERE `Id` = '%d'"; - public $verify_query = "SELECT * FROM containers WHERE `Id` = '%d'"; + public $fill_query = "SELECT * FROM containers WHERE `Id` = :Id"; + public $verify_query = "SELECT * FROM containers WHERE `Id` = :Id"; public $prototype = array( 'string' => array(