hi all,
i have a mast_user table with 20 records......i have prepared a form which updates a particular record successfully......but something pinches me here......it updates username of the table and the user can assign the existing username to his record......
I mean i want to add a validation code which says "username already exists....please update with a different username if u really want to change"
but i cant figure out...where to add this...especially when the variables are sent by GET method.......ie passes thru querystring into the other file where GET_VARS are there.
i also dont want the common user to avoid changing the administrator details.....i mean how shud i do it.......the third file is coded by me as follows where update is executed....
plz help me.......out heres the third file......plz edit it
<?
include"../include/mysqlconnect.php";
$user_id=$HTTP_GET_VARS['userid'];
$user_name=$HTTP_GET_VARS['username'];
$user_pass=$HTTP_GET_VARS['password'];
$user_fname=$HTTP_GET_VARS['firstname'];
$user_lname=$HTTP_GET_VARS['lastname'];
$sql7="update mast_user set user_name='$user_name',user_pass='$user_pass',user_fname='$user_fname',user_lname='$user_lname' where user_id=$userid";
$result7=mysql_query($sql7,$conn);
if($result7)
{
echo("useraccount updated");
}
?>


