$stmt = $db->query("SELECT * FROM posts where pos in ('slider', 'right', 'below') limit " . $limit . " offset " . $offset);
This gives me posts where pos
is slider
or right
or below
with limit and offset params.
What I need is:
- select all posts with pos
= slider
or right
- without limit
and offset
- plus - posts with pos
= below
- using limit
and offset
params.
It can be done using twice $stmt
but I need to join the two selections for processing all selected posts at once.
UPDATE
I tried:
$stmt = $db->query("SELECT * FROM posts where pos in ('slider', 'right')
UNION
(SELECT * FROM posts where pos = 'below' limit 8");
Syntax error.
Any help?