View Full Version : adding value from dropdown or textfield to one database field

04-17-2009, 05:02 PM
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());
im a newbie to php/mysql
please help!

04-17-2009, 05:17 PM
BBCode syntax highlighter shows a syntax error(missing quotes) in your above posted code.

04-17-2009, 05:20 PM
please gimme the solution

04-17-2009, 06:49 PM
As abduraooft said, look at what you posted and you'll see the error. He even told you what it was (a missing quote).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum