Well, first off, I want it to display the right names under the correct rank. Not just a list of all the members. Although I did try and use your code in with mine and here is what I came up with:
Code:
<?php
include('admincp/mysql_connect.php');
$main = "SELECT * FROM members WHERE rank=";
$sql["Council"] = $main . "Council";
$sql["Senior Members"] = $main . "Senior Members";
$sql["Members"] = $main . "Members";
echo '<div style="text-align: center">';
foreach($sql as $key => $current){
echo "<p><u>$key</u></p><p>";
if($ret = mysql_query($main))
{
while($row = mysql_fetch_array($ret))
{
echo $row['member'] . '<br />';;
}
} else {
die('MySQL Error: ' . mysql_error());
}
echo '</p><p> </p>';
}
?>
I get an error under the council rank saying:
"You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
I tryed taking out (WHERE rank=") but it just displays all the members under all the ranks.