hi. i have an php page that pulls information from a mysql database for an address book. when the information is posted to the php page, it shows up all in one long column. i would like to be able to put two results in one row, and then have the next results wrap to a new row. the code is as follows:
$result = mysql_query("SELECT * FROM $table ORDER BY firstname",$db);
echo "<table cellpadding=2 cellspacing=1 border=0>";
$alternate = "2";
while ($row = mysql_fetch_array($result)) {
$id = $row["id"];
$firstname = $row["firstname"];
$lastname = $row["lastname"];
if ($alternate == "1") {
$color = "#ffffff";
$alternate = "2";
}
else {
$color = "#f2f2f2";
$alternate = "1";
}
echo "<tr bgcolor=$color><td><a href='view.php?id=$id'>$firstname $lastname</a></td>";
}
echo "</table>";
I currently have 75 records in the database, all which post in one long column on my php page. Any help would be appreciated. Thanks.