Please have a look to the attachment to see what im trying to do. Database field= "Age" i want that if a user choose date of birth or if he writes his age in text box, the data goes to the fieldname 'Age ' only how do i do this? $insert = mysql_query("insert into register (Name,Gender,DOB,Age,TOB,POB) values ('".$_SESSION['Name']."', '".$_SESSION['Gender']."', '".$_SESSION['DateofBirth']."', '".$_SESSION['Age']."', '".$_SESSION['Timeofbirth']."', '".$_SESSION['Placeofbirth']."') or die("Could not insert data because ".mysql_error()); PHP: im a newbie to php/mysql please help!
What you are trying to achieve ? You'll need to check it and execute 2 different SQL queries - one if it's empty, second if it's filled in.