storing exploded values into separate db fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agarwalsrushti
    New Member
    • Feb 2008
    • 63

    storing exploded values into separate db fields

    hi,
    I ve made a form in php. In that i ve asked the user to fill in the skill sets separated by comma. for eg. key skills: C, C++, Java.
    Now when the user enters the data here i want to store that data in database. Ive stored that data in a array variable using the explode function. Here is a sample of code that i am using. I wanted to know how can i store this kind of data in database so that the data corresponds to a particular users profile.
    Im not able to store it in database.
    [code=php]
    $skills = "C, C++, Java, PHP";
    $arrSkills = explode(",",$sk ills);
    foreach($arrSki lls as $v){
    echo trim($v);
    }
    [/code]

    Its printing the names but how to store in database. Plz help me out.
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Do you want to store each skill in a separate db field or just the entire string. If the former, do you then have separate db fields for each skill? Show your MySQL data (table info).

    Ronald

    Comment

    Working...