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:
You can store in a variable if u r planning to use it in a function or you can just print it. Either way...
$q = "SELECT name, address, content FROM mytable";
$r = mysqli_query($dbc, $q);
$str = "";
while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
$str .= "";
$str .= "" . $row['name'] . " ";
$str .= "" . $row['address'] . " ";
$str .= "" . $row['content'] . " ";
$str .= " ";
}
$str .= "
"
echo $str;
There you go!