About the error you're getting try this:
("UPDATE act_details
SET ... gender='".$_POST['gender']."', ...
WHERE ID = '".$user."' LIMIT 1")
Notice the single quotes around value of the gender... I cannot tell whether it will help with your error, but please do try to use it...
Second: safety of your code - there isn't one if you're using it like you showed us...
Bad user can create a form by himself and add values to gender field like he wants to - like:
''; DELETE TABLE;
or whatever like that to screw up your database...
I strongly suggest you predict the possible values your POST variable should have and act accordingly:
if(isset($_POST['gender'])){
if($_POST['gender']=="M"){
$gender = "M";
}
else if($_POST['gender']=="F"){
$gender = "F";
}
else{
$gender = "M";
}
}
This way you will prevent SQL injection attack that can be very serious for your application...