cc-4347: PDOOO

This commit is contained in:
Rudi Grinberg 2012-09-07 11:52:57 -04:00
parent 92682b9f89
commit 22a250b5d2
1 changed files with 13 additions and 5 deletions

View File

@ -355,14 +355,22 @@ SQL;
$uncheckedDaysImploded = implode(",", $daysRemovedUTC); $uncheckedDaysImploded = implode(",", $daysRemovedUTC);
$showId = $this->getId(); $showId = $this->getId();
$esc_uncheckedDays = pg_escape_string($uncheckedDaysImploded);
$timestamp = gmdate("Y-m-d H:i:s"); $timestamp = gmdate("Y-m-d H:i:s");
$sql = "DELETE FROM cc_show_instances" $sql = <<<SQL
." WHERE EXTRACT(DOW FROM starts) IN ($uncheckedDaysImploded)" DELETE
." AND starts > TIMESTAMP '$timestamp'" FROM cc_show_instances
." AND show_id = $showId"; WHERE EXTRACT(DOW FROM starts) IN ($esc_uncheckedDays)
AND starts > :timestamp::TIMESTAMP
AND show_id = :showId
SQL;
$con->exec($sql); Application_Common_Database::prepareAndExecute( $sql,
array(
":timestamp" => $timestamp,
":showId" => $showId,
), "execute");
} }
/** /**