With the delete members part I have added a field in my table called 'user_level', with 1= Admin and 2= User. What I want is to be able to stop Admin from being deleted.
Could somebody tell me where I am going wrong with the user level code? Thank you.
<?php
require_once("Connections/connection.php"); //database connection //
session_start();
include("includes/security.php");
$id = $_SESSION['id'];
/////////////////////////////////////////
$user = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$submit = $_POST['submit'];
$del = $_GET['del'];
////////////////////////////////////////
///////////////////////////////
$query =sprintf("SELECT * FROM users"); // * means all, so 'select all data from table 1 //
$result =@mysql_query($query);
$row =mysql_fetch_array($result);
////////////////////////////
if($row['user_level'] !=1){
}
if ($del){
//////////////
$query = sprintf("DELETE FROM users where user_id='$del'");
mysql_query($query) or die (mysql_error());
//////////////
}
?>
