diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 84a79528c..06b6aadf3 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -572,15 +572,16 @@ SQL; */ public function deleteAllRebroadcasts() { - $con = Propel::getConnection(); - - $timestamp = gmdate("Y-m-d H:i:s"); - - $showId = $this->getId(); - $sql = "DELETE FROM cc_show_instances" - ." WHERE starts > TIMESTAMP '$timestamp'" - ." AND show_id = $showId" - ." AND rebroadcast = 1"; + $sql = << :timestamp::TIMESTAMP + AND show_id :showId + AND rebroadcast 1 +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':showId' => $this->getId(), + ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); $con->exec($sql); }