View Single Post
Old 04-13-2005   #6 (permalink)
ViciOuS
Registered User
 
ViciOuS's Avatar
 
Join Date: Apr 2005
Posts: 82

Okay, here is my code for members.php:

Code:
<?php
include('admincp/mysql_connect.php');

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

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

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['member'] . '<br />';
}

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

}

?>
Even though i'm not exactly sure how $current works in foreach($sql as $key => $current){

I still changed everything else that needed to be changed to fit my MySQL db and etc.

Check the page to see the error.
ViciOuS is offline