I do this:
<?
// stuff above....
$sqlmembers = mysql_query ("SELECT nick_name,email, url FROM members ORDER by id asc");
print("<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">\n");
while($row = @mysql_fetch_row($sqlmembers))
{
$nick_name = $row[0];
$email = $row[1];
$url = $row[2];
print("<tr>\n");
print("<td width=\"50%\">$nick_name</td><td width=\"25%\">$email</td><td width=\"25%\">$url</td>";
print("</tr>\n");
}
print("</table>\n");
// etc code down here...
?>
That will start the table, then create a new <tr> for each result row.
This should at least point you in a good in a direction...
-- Jason
Four_D wrote:
What is wrong with this? All I want is the three fields info to be displayed in table format, but all it does is display the nick_names in all three coloumns in a continuos loop.
$sqlmembers = mysql_query ("SELECT nick_name,email, url FROM members ORDER by id asc");
while(mysql_fetch_row($sqlmembers)){
$nick_name=mysql_result($sqlmembers);
$email=mysql_result($sqlmembers);
$url=mysql_result($sqlmembers);
echo "<table border='1'cellpadding='1' cellspacing='1' width='100%'>";
echo "<tr>";
echo "<td width='50%'>$nick_name</td><td width='25%'>$email</td><td width='25%'>$url</td>";
echo "</tr>";
}
Donald