Thread: Still lost

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    I have a mutiple select box in form abc[]. It returns an array as expected. I can break out the vars from the aray. I am not able to put the array in to mysql and get the aray back out. The only thing that ends up in the db is the word array. Ready to bang head on monitor.

    Thanks for your help Bill
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    There is no array datatype so you can't just insert an array into the database. Do you want to have all elements of the array in the same field?

    If so, you can implode() the array into one variable and then insert that.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    59
    Rep Power
    15
    If you don't you can just loop through the array like:

    for ($i = 0; $i < count($array); $i++)
    {
    mysql_query("INSERT etc. $array[$index]");
    }

    Chris
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    Thanks Guys for the fast answers. Rod That did the trick.

Similar Threads

  1. lost data on reboot
    By sreeli in forum MySQL Help
    Replies: 2
    Last Post: August 19th, 2003, 05:24 AM
  2. I'm totally lost!
    By sbilheimer in forum Beginner Programming
    Replies: 2
    Last Post: August 15th, 2003, 09:32 AM
  3. Replies: 3
    Last Post: October 7th, 2002, 11:26 AM
  4. Locked Out? Lost Password? Employee Left?
    By ntbootdisk in forum Windows Help
    Replies: 1
    Last Post: June 19th, 2002, 09:46 AM
  5. hdc: lost interrupt
    By Reean in forum Linux Help
    Replies: 0
    Last Post: March 19th, 2002, 12:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo