Hi I have been using this code to fetch data from mysql database and displaying it in column format i.e
a
b
c
What i want is to show 4 names per row i.e
a b c d
e f g....
Can anybody help me in this regard
Thankyou.
Here is my code
<?php
$result = mysql_query("SELECT * FROM Persons");
echo "<table border='1'>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Name'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
Use modulus operator
%As a bonus, you’ve got syntax error in your code. Look at this line
which
should be