I have searched over 1500 posts over the last 2 weeks and have not found the solution to make my code work. My registration and login forms work correctly but when the user logins to add or edit information the sql database does not update with the users input and the error/updated message does not echo. My users register with name, surname, email and password but once they login they need to add to their personal information and later be able to edit the personal information. But nothing I've tried has worked...please help me I really need to get this right.... my code is as follows:
PHP CODE:
<?php
include_once "connect_to_mysql.php";
$id = $_SESSION['id'];
$title=$_POST['title'];
$username=$_POST['username'];
$surname=$_POST['surname'];
$identityno=$_POST['identityno'];
$gender=$_POST['gender'];
$birthdate = strftime("%d %b %Y", strtotime($row['birthdate']));
$ethnicity=$_POST['ethnicity'];
$nationality=$_POST['nationality'];
$homeaddress=$_POST['homeaddress'];
$province=$_POST['province'];
$suburb=$_POST['suburb'];
$hometele=$_POST['hometele'];
$celltele=$_POST['celltele'];
$creditclear=$_POST['creditclear'];
$criminalrecord=$_POST['criminalrecord'];
$driverslicense=$_POST['driverslicense'];
$owntransport=$_POST['owntransport'];
$medicalconditions=$_POST['medicalconditions'];
$query("UPDATE cic_candidates SET title='$title', username='$username', surname='$surname',
identityno='$identityno', gender='$gender', birthdate='$birthdate', ethnicity='$ethnicity',
nationality='$nationality', homeaddress='$homeaddress', province='$province', suburb='$suburb',
hometele='$hometele', celltele='$celltele', creditclear='$creditclear',
criminalrecord='$criminalrecord', driverslicense='$driverslicense',
owntransport='$owntransport', medicalconditions='$medicalconditions' WHERE id='$id'");
mysql_query($query);
echo 'Your account info has been updated, you will now see the new info.<br /><br />
To return to your profile edit area, <a href="edit_personal_details.php">click here</a>';
exit();
mysql_close();
?>