diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 0323ac330..56ef05405 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -528,15 +528,18 @@ SQL; */ public function getRepeatingEndDate() { - $con = Propel::getConnection(); + $sql = <<getId(); - $sql = "SELECT last_show FROM cc_show_days" - ." WHERE show_id = $showId" - ." ORDER BY last_show DESC"; - - $query = $con->query($sql)->fetchColumn(0); + $query = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $this->getId() ), 'column' ); + /* TODO: Why return empty string instead of false? very confusing --RG + */ return ($query !== false) ? $query : ""; }