I have this array named $myArray:
Array (
[0] => bb
[1] => kk
[2] => ll )
On which I´m querying with:
$sql = ("SELECT username FROM Users WHERE username IN ('" . implode("','",$myArray) . "') AND status > 0 ");
$result = $conn->query($sql)->fetchAll(PDO::FETCH_ASSOC);
print_r ($result);
What I get is:
Array (
[0] => Array ( [username] => bb )
[1] => Array ( [username] => kk ) )
But what I want to get is:
Array (
[0] => bb
[1] => kk ) )
What can I do to achieve this?
Thanks in advance!