Hello,
I am trying to make a mysql query that will update a users rank in the database. Below, I have posted the whole code, SQL included. Can you guys see why its not working?
case'editusr':
include('config.php');
$ranks = array('Banned' => 0, 'Admin' => 1, 'User' => 2);
if($_SESSION['s_rank'] == "2") {
echo'You do not have the permissions to view this page.';
}
if($_SESSION['s_rank'] == "1"){
$result = mysql_query("UPDATE * FROM Users WHERE Username is defined by 'Username' And if 0 = 'Banned' or 1 = 'Admin' or 2 = 'User'");
echo'On this page you can edit the rank of a user.
<p>
<form action="'.$_SERVER['PHP_SELF'].'" method="post">
<p>Username to Edit:<br>
<input name="Username" type="text" class="textBox"></p>
<p>Change To:<br>
<select name="user_level">
<option value="' .$ranks['Banned']. '">Banned</option>
<option value="' .$ranks['Admin']. '">Admin</option>
<option value="' .$ranks['User']. '">User</option>
</select></p>
<p><input type="submit" value="Change Rank" name="changerank"></p>
</form>
';
}
break;