Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question adding value from dropdown or textfield to one database field

    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?
    PHP Code:
    $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!
    Attached Thumbnails Attached Thumbnails adding value from dropdown or textfield to one database field-2009-04-17_132750.jpg  
    Last edited by gspabla; 04-17-2009 at 05:11 PM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    BBCode syntax highlighter shows a syntax error(missing quotes) in your above posted code.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Apr 2009
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    please gimme the solution

  • #4
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,306
    Thanks
    4
    Thanked 205 Times in 202 Posts
    As abduraooft said, look at what you posted and you'll see the error. He even told you what it was (a missing quote).
    Dave .... HostMonster for all of your hosting needs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •