Displaying a member list

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Rob
Forum Commoner
Posts: 33
Joined: Fri Oct 03, 2003 3:18 pm

Displaying a member list

Post by Rob »

How would I display every username in a SQL table in a html table?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Code: Select all

$result = mysql_query("select username from username_table");
echo '<table>';
while ($row = mysql_fetch_array($result)) {
    echo '<tr><td>'.$row[0].'</td></tr>';
}
echo '</table>';
User avatar
Rob
Forum Commoner
Posts: 33
Joined: Fri Oct 03, 2003 3:18 pm

Post by Rob »

thanks
Post Reply