I am retrieving the rows of my query as such:
$rows = mysqli_fetch_all($result, MYSQLI_ASSOC);
How can I do:
(PSEUDO CODE)
for each row in rows
echo row
I can just "echo $rows" but that doesn't allow me to go through each row on a separate paragraph.
As a second question, how can I go through each column of a row:
(PSEUDO CODE)
for each row in rows
for each column in row
echo column
I would use something like this:
where result is:
I have written a small code, hope it solves the query.
Example Database Table Mysql Table snapshot Code
Output of the code
Use the
mysqli_fetch_assoc
function.And the use the foreach as:
Note: You can also use
foreach
withmysqli_fetch_all
.You pseudo code is all fine.. you just need to turn it into PHP....
Answer to first question:
Second question.. something like: