Is it normal that I get a result with as many arrays as the number of rows in my table when I do a PDO request with the code below :
$query3 = $bdd->prepare('select id, MAX(priority), question from questions');
$query3->execute();
$row = $query3->fetch(PDO::FETCH_ASSOC);
print_r($row);
Here is the result I get :
Array (
[id] => 2
[MAX(priority)] => 117820
[question] => Question ?
)
Array (
[id] => 2
[MAX(priority)] => 117820
[question] => Question ?
)
Array (
[id] => 2
[MAX(priority)] => 117820
[question] => Question ?
)
Array (
[id] => 2
[MAX(priority)] => 117820
[question] => Question ?
)
Array (
[id] => 2
[MAX(priority)] => 117820
[question] => Question ?
)
Is there something I should do differently to get only one result in $row?
Thanks