My code below displays 10 entries, but it displays it in 10 rows and 1 column. I would like for it to display 10 entries, but in 2 columns and 5 rows. Can anyone help? Thanks in advance.
< ?php
mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$result = mysql_query("SELECT * FROM Members LIMIT 0, 10")
or die(mysql_error());
echo '<table>';
echo '<tr>';
while($row = mysql_fetch_array( $result )) {
if ($row['Approved']=='No')
{
continue;
}
else{
echo '<td>';
echo "ID Number: ".$row['id'];
echo "<br/>";
echo '<a href="original/'.sha1($row['Username']).'.jpg"><img src="'.$row['Pic'].'"></a>';
echo "<br/>";
echo '<hr>';
echo '<tr>';
}
}
echo '</table>'
?>
Please note that the mod logic will only work if the starting value of $i is ‘1’.
This code will create a table with 2 columns.