You actually have a few issues going on here. the first is that you're using 'edit' instead of 'UPDATE'. sql isn't case sensitive, but it's common practice to make sql keywords all caps, and definitely using the right word helps immensely.
You also only have to use the word 'SET' once in your update query. In addition to that, on your individual assignments in the sql string, you don't want to quote the field names, because that turns them into literal strings, but you DO want to put quotes around the string values and numeric values do not need to be quoted. so this line:
$query = "edit logindetail set 'firstname'=$firstname, set 'lastname'=$lastname', set 'gender'=$gender, set 'birthday'=$birthday,set 'city'=$city, set 'state'=$state WHERE id ='$_SESSION[Suserid]'";
Code: Select all
$query = "UPDATE logindetail SET firstname='". $firstname . "', lastname='". $lastname . "', gender='" . $gender . "', birthday='" . $birthday . "',city='". $city . "',state='" . $state . "' WHERE id=" . $_SESSION['suserid'];