B
B
BoriHagen2020-04-23 20:32:07
PHP
BoriHagen, 2020-04-23 20:32:07

Why does print_r output only one element?

There is a DB with the table orders. I make a request:

$orders_data = mysqli_query($connection, "SELECT * FROM `orders`");

$orders_assoc = mysqli_fetch_assoc($orders_data);

print_r($orders_assoc);


But print_r for some reason displays only the first element from the database, stubbornly ignoring the other two.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-04-23
@BoriHagen

And how much should it be, given that mysqli_fetch_assoc gets one row from the fetch result?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question