What is the result of executing a statement in PDO if it contains two select queries? Consider this table:
A B
------
a 1
b 2
c 3
d 4
e 5
f 6
and this PDO query:
$sql = $pdo->prepare("
SELECT A FROM Table WHERE B > 3;
SELECT A FROM Table WHERE B < 3;
");
$sql->execute();
What will $sql->fetchAll() return?
Combine queries using
UNION ALLLike so:
First select statement returns the records d,e,f for A.
Second statement returns a,b for A.
The result is combined into one single return
d,e,f,a,bNow can I have my points 😉 (just kidding)