From d194ff1809b2280fe2dbde4f6b739cbddfa47f35 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 12 Sep 2012 12:05:03 -0400 Subject: [PATCH] PDO'd a few things missed before in cancelShow() --- airtime_mvc/application/models/Show.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index dbcf76c59..bb1ff663c 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -287,11 +287,16 @@ SQL; ->filterByDbShowId($this->_showId) ->update(array('DbLastShow' => $timeinfo[0])); - $sql = "UPDATE cc_show_instances - SET modified_instance = TRUE - WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}"; + $sql = <<= :dayTimestamp::TIMESTAMP + AND show_id = :showId +SQL; - $con->exec($sql); + Application_Common_Database::prepareAndExecute( $sql, array( + ':dayTimestamp' => $day_timestamp, + ':showId' => $this->getId()), 'execute'); // check if we can safely delete the show $showInstancesRow = CcShowInstancesQuery::create() @@ -300,7 +305,9 @@ SQL; ->findOne(); if (is_null($showInstancesRow)) { - $sql = "DELETE FROM cc_show WHERE id = :show_id"; + $sql = << $this->_showId ), "execute"); $con->exec($sql);