Answer the question
In order to leave comments, you need to log in
Why do the rows received after SELECT behave like this?
I do
$query1_string = "SELECT `manufacturer_id` FROM `oc_manufacturer`";
$query1 = mysqli_query($connect_bd, $query1_string);
echo mysqli_num_rows($query1);
$arrayQuery = mysqli_fetch_assoc($query1);
var_dump($arrayQuery); // выдает только первую строчку в колонке MySQL
foreach($arrayQuery as $Query){ // Форич показывает, так же одну строку ассоциативного массива - ключ, значение.
echo $Query;
}
while($arrayQuery = mysqli_fetch_assoc($query1)){ // А вот вайл показывает все 862 значения....
echo $arrayQuery;
}
Answer the question
In order to leave comments, you need to log in
Read the documentation. Re-read the documentation. Understand what is written in the documentation. Or here:
$arrayQuery = mysqli_fetch_all($query1, MYSQLI_ASSOC);
var_dump($arrayQuery);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question