PDA

View Full Version : Deleting Problem


cocoonfx
10-26-2007, 09:31 AM
Hello


I have a created a table which is identical to the tutorial posted on the forum where you can update and delete records from a table.

I have changed it to have a session control based on user rights so a member with Administration rights can delete records and a normal users does not see the table at all.

However i have realised that the Admin user who has logged in can actually delete his own account while he is logged on.

I have tried to do an if statement similar to below:

if($del && user_id == '$id'){ /// $id controls the session ///
echo "you can not delete";
}elseif{ $del && user_id !== '$id')
Delete statement
}


However when i do this if statement i can not delete the record but also i lose the option to update records or delete anything.

Can anyone point me in the direction on how to do this?

I will post my code if needed.

davidj
10-26-2007, 01:39 PM
where you have this...
if($del && user_id == '$id'){ /// $id controls the session ///

notice that you have missed a $ from your user_id variable