View Single Post
Old 04-13-2005   #5 (permalink)
scrowler
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
Code:
<?php

mysql_connect("localhost", "user", "pass");
mysql_select_db("db_name");

$main = "SELECT * FROM members WHERE rank = ";

# edit the ends of the following to mimic the MySQL stored data that determines ranking.
# edit the keys of the array to mimic the desired output ranking.
$sql["Leader"] = $main . "Leader";
$sql["Council"] = $main . "Council";
$sql["Senior Members"] = $main . "SeniorMembers";
$sql["Members"] = $main . "Members";

echo '<div style="text-align: center">';

foreach($sql as $key => $current){

echo "<p><u>$key</u></p><p>";

$do = mysql_query($current);
while($row = mysql_fetch_assoc($do)){
echo $row['name'] . '<br />';
}

echo '</p><p>&nbsp;</p>';

}

?>
try that
__________________
BioRUST Tutorials - the birthplace
scrowler is offline