From 26c2c2c0d152a06287f5058e2538b0c173f5709e Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 5 Sep 2012 17:52:53 -0400 Subject: [PATCH] CC-4345: Prepared statements - part 1 -added extra parameter to prepareAndExecute() --- airtime_mvc/application/common/Database.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/common/Database.php b/airtime_mvc/application/common/Database.php index 40a8309f1..bf8e44ea3 100644 --- a/airtime_mvc/application/common/Database.php +++ b/airtime_mvc/application/common/Database.php @@ -1,9 +1,8 @@ prepare($sql); foreach ($paramValueMap as $param => $v) { @@ -12,11 +11,11 @@ class Application_Common_Database $rows = array(); if ($stmt->execute()) { if ($type == 'single') { - $rows = $stmt->fetch(PDO::FETCH_ASSOC); - } elseif ($type == 'column'){ + $rows = $stmt->fetch($fetchType); + } else if ($type == 'column'){ $rows = $stmt->fetchColumn(); } else { - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); + $rows = $stmt->fetchAll($fetchType); } } else { $msg = implode(',', $stmt->errorInfo());