PDO'd UpdateBroadcastedStatus

This commit is contained in:
Rudi Grinberg 2012-09-12 16:09:28 -04:00
parent 643c00418a
commit 414d1fa511
1 changed files with 11 additions and 4 deletions

View File

@ -381,11 +381,18 @@ SQL;
global $CC_CONFIG;
$con = Propel::getConnection();
$now = $dateTime->format("Y-m-d H:i:s");
$sql = "UPDATE ".$CC_CONFIG['scheduleTable']
." SET broadcasted=$value"
." WHERE starts <= '$now' AND ends >= '$now'";
$retVal = $con->exec($sql);
$sql = <<<SQL
UPDATE cc_schedule
SET broadcasted=:broadcastedValue
WHERE starts <= :starts::TIMESTAMP
AND ends >= :ends::TIMESTAMP
SQL;
$retVal = Application_Common_Database::prepareAndExecute($sql, array(
':broadcastedValue' => $value,
':starts' => $now,
':ends' => $now), 'execute');
return $retVal;
}