MySQL and PHP if statements
**EDIT, I MEANT RANK 3 OR HIGHER**

I am working on a community.  I want it so theres an administrator file!  The person's rank (I added a rank column in my MySQL database, with rank 1- Member, 2- Worker, 3- Admin),  and their rank has to be 2 or greator to view the table of users on this page.  I used the following code:  (Please note I am trying to make it their user's session rank, started from the login system).

    <?php
    
    $connect = mysql_connect("", "", "") or
    
    die ("There was an error");
    
    mysql_select_db("");
    
    $quey1="select * from users";
    
    $result=mysql_query($quey1) or die(mysql_error());
    
         if ($_SESSION['rank']<=3) {
    
                    $connect = mysql_connect("", "", "") or
    
                    die ("There was an error");
    
                    mysql_select_db("");
    
                    $quey1="select * from users";
    
                    $result=mysql_query($quey1) or die(mysql_error());
    
    
                    <table border=2>
    
                    <caption>Users</caption>
    
                    <tr>
    
                    <th>User ID</th>
    
                    <th>Username</th>
    
                    <th>Email</th>
    
                    <th>Rank</th>
    
                    </tr>
    
    
                    while($row=mysql_fetch_array($result)){
    
                    echo "</td><td>";
    
                    echo $row['id'];
    
                    echo "</td><td>";
    
                    echo $row['uname'];
    
                    echo "</td><td>";
    
                    echo $row['email'];
    
                    echo "</td><td>";
    
                    echo $row['rank'];
    
                    echo "</td></tr>";
    
                    echo "</table>";
    
                                } else {
                                      echo "o";
                                }
                             }
    ?>

(indented for you guys xD), and it is giving me unexpected statements.  Anyone know why? Btw, I do have all the mysql configured, I just removed it so you guys don't take it. :P

Please help me.
:(
MySQL and PHP if statements
===

**EDIT, I MEANT RANK 3 OR HIGHER**

I am working on a community.  I want it so theres an administrator file!  The person's rank (I added a rank column in my MySQL database, with rank 1- Member, 2- Worker, 3- Admin),  and their rank has to be 2 or greator to view the table of users on this page.  I used the following code:  (Please note I am trying to make it their user's session rank, started from the login system).

    <?php
    
    $connect = mysql_connect("", "", "") or
    
    die ("There was an error");
    
    mysql_select_db("");
    
    $quey1="select * from users";
    
    $result=mysql_query($quey1) or die(mysql_error());
    
         if ($_SESSION['rank']<=3) {
    
                    $connect = mysql_connect("", "", "") or
    
                    die ("There was an error");
    
                    mysql_select_db("");
    
                    $quey1="select * from users";
    
                    $result=mysql_query($quey1) or die(mysql_error());
    
    
                    <table border=2>
    
                    <caption>Users</caption>
    
                    <tr>
    
                    <th>User ID</th>
    
                    <th>Username</th>
    
                    <th>Email</th>
    
                    <th>Rank</th>
    
                    </tr>
    
    
                    while($row=mysql_fetch_array($result)){
    
                    echo "</td><td>";
    
                    echo $row['id'];
    
                    echo "</td><td>";
    
                    echo $row['uname'];
    
                    echo "</td><td>";
    
                    echo $row['email'];
    
                    echo "</td><td>";
    
                    echo $row['rank'];
    
                    echo "</td></tr>";
    
                    echo "</table>";
    
                                } else {
                                      echo "o";
                                }
                             }
    ?>

(indented for you guys xD), and it is giving me unexpected statements.  Anyone know why? Btw, I do have all the mysql configured, I just removed it so you guys don't take it. :P

Please help me.
:(