mirror of
https://github.com/standardebooks/web.git
synced 2025-07-19 12:54:48 -04:00
Pretty print SQL
This commit is contained in:
parent
31a8bc2d6c
commit
26a24cdbe2
17 changed files with 316 additions and 82 deletions
|
@ -1,9 +1,23 @@
|
|||
<?
|
||||
require_once('Core.php');
|
||||
|
||||
$pastPolls = Db::Query('select * from Polls where utc_timestamp() >= End order by Created desc', [], 'Poll');
|
||||
$pastPolls = Db::Query('
|
||||
SELECT *
|
||||
from Polls
|
||||
where utc_timestamp() >= end
|
||||
order by Created desc
|
||||
', [], 'Poll');
|
||||
|
||||
$openPolls = Db::Query('select * from Polls where (End is null or utc_timestamp() <= End) and (Start is null or Start <= utc_timestamp()) order by Created desc', [], 'Poll');
|
||||
$openPolls = Db::Query('
|
||||
SELECT *
|
||||
from Polls
|
||||
where (end is null
|
||||
or utc_timestamp() <= end)
|
||||
and
|
||||
(start is null
|
||||
or start <= utc_timestamp())
|
||||
order by Created desc
|
||||
', [], 'Poll');
|
||||
|
||||
?><?= Template::Header(['title' => 'Polls', 'highlight' => '', 'description' => 'The various polls active at Standard Ebooks.']) ?>
|
||||
<main>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue