From 45729f16e77112db9f1030dfa974318c4945ec62 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 6 Sep 2012 14:14:05 -0400 Subject: [PATCH] cc-4347: PDOOOOOOOOOOOOOOOO --- airtime_mvc/application/models/Show.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index dd3a1e520..610ce3647 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -127,14 +127,14 @@ class Application_Model_Show $sql = "SELECT first_name, last_name FROM cc_show_hosts LEFT JOIN cc_subjs ON cc_show_hosts.subjs_id = cc_subjs.id - WHERE show_id = {$this->_showId}"; + WHERE show_id = :show_id"; - $hosts = $con->query($sql)->fetchAll(); + $hosts = Application_Common_Database::prepareAndExecute( $sql, + array( ':show_id' => $this->_showId ), 'all'); - $res = array(); - foreach ($hosts as $host) { - $res[] = $host['first_name']." ".$host['last_name']; - } + $res = array_map( function($host) { + return $host['first_name']." ".$host['last_name']; + }, $hosts); return $res; }