cc-4347: GetShowInstanceCount() pdo'd

This commit is contained in:
Rudi Grinberg 2012-09-10 11:29:28 -04:00
parent 375e89169e
commit e2c2f67fbb
1 changed files with 7 additions and 5 deletions

View File

@ -809,11 +809,13 @@ SQL;
// returns number of show instances that ends later than $day // returns number of show instances that ends later than $day
public static function GetShowInstanceCount($day) public static function GetShowInstanceCount($day)
{ {
global $CC_CONFIG; $sql = <<<SQL
$con = Propel::getConnection(); SELECT count(*) AS cnt
$sql = "SELECT count(*) as cnt FROM $CC_CONFIG[showInstances] WHERE ends < '$day'"; FROM cc_show_instances
WHERE ends < '$day'
return $con->query($sql)->fetchColumn(0); SQL;
return Application_Common_Database::prepareAndExecute( $sql,
array( ':day' => $day ), 'column' );
} }
// this returns end timestamp of all shows that are in the range and has live DJ set up // this returns end timestamp of all shows that are in the range and has live DJ set up