I am trying to get all the values from a column with mysqli. I have tried
$emaildbs = $db->query("SELECT email from subscribers");
while($emaildbsrow = $emaildbs->fetch_row()) {
$emaildbsrows[] = $emaildbsrow;
}
var_dump($emaildbsrows);
but the var_dump looks like this:
array(2) {
[0]=>
array(1) {
[0]=>
string(6) "asdasd"
}
[1]=>
array(1) {
[0]=>
string(1) "s"
}
}
and the expected output is
array(2) {
[0]=> string(6) "asdasd"
[1]=> string(1) "s"
}
I have also tried:
with fetch_assoc and I get smth similar. I searched on stackoverflow, and tried numerous functions instead of fetch_row but same thing. Where am I mistaking.