I have a MySQL query with over 50 return results. Now I need to display the results in a table with 3 rows and 3 columns.
Something like this:
use a for
-loop to iterate your $mycontent
-array:
EDIT: I was made aware that $mycontent
is built differently than I first assumed:
$h = ""; // we are going to build the table in $h
$maxcount = count($mycontent); // get the number of values within the array
for ($i = 0;$i < $maxcount;$i++) { // counting $i up from 0 to $maxcount -1 ...
$h.= "{$mycontent[$i]} "; // build row
}
$h.= "
"; // close the table
echo $h; // echo it
---> live demo: http://3v4l.org/g1E1T