hey,
i just got this code, altered it as well so it could go well with my site.
What i want is a cell with 2 bits of information which means i will need 2 rows.
Now i want 2 columns that retirieves these 2 bits of information to each cell referring to its ID.
here is my code.
<? include("header.php"); ?>
<?
$columns = 2;
include('connect.php');
$query = "SELECT * FROM members ORDER BY id DESC";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
echo "<TABLE BORDER=\"0\">\n";
for($i = 0; $i < $num_rows; $i++) {
$row = mysql_fetch_array($result);
if($i % $columns == 1) {
echo "<TR>\n";
}
echo '<tr><td><img src="' . $row[image] . '" /></td></tr><tr><td>' . $row['username'] . '</td></tr>';
if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows) {
//if there is a remainder of 1, end the row
//or if there is nothing left in our result set, end the row
echo "</TR>\n";
}
}
echo "</TABLE>\n";
?>
<? include("footer.php");?>
Why is it that it only shows in one column?? I want all my information to show in 2 columns vertically and not 1 column going down in rows