sql help

Discussion in 'General Scripting Chat' started by cashmaster, Jan 3, 2012.

  1. cashmaster

    cashmaster Junior Member

    Joined:
    Dec 25, 2010
    Messages:
    146
    Likes Received:
    17
    I have a form in my page which have text boxes, text areas, radio boxes, check boxes. I need to update these to a table in a mysql database. But how to create a table that shall include text boxes, text areas, radio boxes, check boxes ?
     
  2. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
    text boxes = VARCHAR
    text areas = VARCHAR (depends on length though)
    radio boxes = INT(1) -> You only need two values. 0 and 1 (0 = false, 1 = true).
    check boxes = If one one value is being stored, then INT(1) and store a numeric value.
    check boxes = If multiple values are being stored, then VARCHAR + I like to json encode them.
     
    • Thanks Thanks x 1
  3. hameem

    hameem Elite Member

    Joined:
    Jul 21, 2011
    Messages:
    1,889
    Likes Received:
    988
    Location:
    221B Baker Street
    Sounds like you have very little idea on how to use scripting languages/programming languages with sql. You probably need to learn a bit of basics.

    Tables don't include those. Tables just store the data that has been extracted by the scripting language you are using.
     
  4. cashmaster

    cashmaster Junior Member

    Joined:
    Dec 25, 2010
    Messages:
    146
    Likes Received:
    17
    I just need to know how to do it with check boxes and radio buttons. Rest i know. I dont think i followed the last part of your post