PHP - add to list functionality?

Discussion in 'PHP' started by deBassMan, Aug 16, 2007.

  1. deBassMan

    deBassMan New Member

    Joined:
    Aug 16, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi all

    I'm new to this forum (and PHP) but quite experienced with VB, VBA etc.

    In MS Access I regularly coded an Auto Add to List combo box - i.e a combo box (like a html select box with more functionality) which automatically added a row in the underlying db if the user entered an option that wasn't there.

    E.g Imagine a select box with options: red, green, blue.

    If the user types: red, then the code (after confirmation) would add it to the db and red would immediately become another valid option in the select box.

    This functionality proved v.popular with users.

    I'd like to simulate this functionality in php and mysql - does anyone have any ideas how this could be achieved?

    thanks in advance
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    You'll need to use JavaScript! Ajax to update the DB and some more JS to update the select box with the new option!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice