#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    27
    Rep Power
    0
    can i use an array as a mysql table? I'd like to create an array which has the following structure:

    ----------------
    file | length
    ----------------
    file1 | length1
    ... | ...

    I read the manual but i don't understand it very well. Maybe someone can provide me a simple example for doing this?

    Thanks, Pieter
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    can i use an array as a mysql table?
    >>

    No,You can't use an array as a mysql table....


    <<
    I'd like to create an array which has the following structure:
    >>


    Are you talking about mutidimensional array?



    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    27
    Rep Power
    0
    yes, i think so
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    but you can hold arrays in tables by doing a kind of csv thingy! - ie a text field holding comma seperated lists.
    You can then explode() the list back into an array when you retrieve the field from the table.
    Its also a good space saver in some circumstances.

    ie: if $myrow[$x]contains, "apple,pear,beer,more beer,asprin"
    $stuff=$myrow[$x];
    then (eg) explode(",",$stuff);
    now $stuff[] contains 'apple' etc

    If you use different delimiters you can even do multi-dimensional ones:

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. UNIQUE Values for a column -newbie question
    By bobby11 in forum MySQL Help
    Replies: 3
    Last Post: February 5th, 2004, 07:31 AM
  2. Newbie table creation question
    By andy collins in forum PostgreSQL Help
    Replies: 3
    Last Post: January 23rd, 2004, 03:27 PM
  3. SQL Query question (Joining tables with missing rows)
    By LiquidKernel in forum MySQL Help
    Replies: 4
    Last Post: January 17th, 2004, 11:20 PM
  4. mySQL tables question
    By IceHammer in forum PHP Development
    Replies: 2
    Last Post: January 17th, 2004, 01:28 PM
  5. ok super newbie question
    By SCerviche in forum Flash Help
    Replies: 5
    Last Post: January 11th, 2004, 03:29 PM

IMN logo majestic logo threadwatch logo seochat tools logo