Refactored sql substition into pdo
This commit is contained in:
parent
a731fc147b
commit
27ea00f5d4
airtime_mvc/application/models
|
@ -1620,12 +1620,17 @@ class Application_Model_Show
|
||||||
$startTimeString = $today_timestamp->format("Y-m-d H:i:s");
|
$startTimeString = $today_timestamp->format("Y-m-d H:i:s");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT * FROM cc_show_days
|
$con->prepare("
|
||||||
|
SELECT * FROM cc_show_days
|
||||||
WHERE last_show IS NULL
|
WHERE last_show IS NULL
|
||||||
OR first_show < '{$endTimeString}' AND last_show > '{$startTimeString}'";
|
OR first_show < :endTimeString AND last_show > :startTimeString");
|
||||||
|
|
||||||
//Logging::info($sql);
|
$stmt = $con->execute(array(
|
||||||
$res = $con->query($sql)->fetchAll();
|
':endTimeString' => $endTimeString,
|
||||||
|
':startTimeString' => $startTimeString
|
||||||
|
));
|
||||||
|
|
||||||
|
$res = $stm->fetchAll();
|
||||||
foreach ($res as $row) {
|
foreach ($res as $row) {
|
||||||
Application_Model_Show::populateShow($row, $p_endTimestamp);
|
Application_Model_Show::populateShow($row, $p_endTimestamp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue