Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    3

    Unanswered: how to store 2d array in mysql table

    hi,
    how to save 2D array in mysql table. can anyone please give me the query...........
    regards
    eclipse3.4ide

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    CREATE TABLE my_2d_array
    ( x INTEGER NOT NULL 
    , y INTEGER NOT NULL 
    , PRIMARY KEY ( x , y )
    , cellvalue INTEGER NOT NULL DEFAULT 0
    );
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2009
    Posts
    3

    how to store 2d array in database....

    can u please give me the sample insert query for storing the values into database...

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    INSERT
      INTO my_2d_array
         ( x, y, cellvalue )
    VALUES
         ( 1, 1, 321 )
       , ( 1, 2, 432 ) 
       , ( 1, 3, 654 ) 
       , ( 1, 4, 876 ) 
       , ( 2, 1, 567 ) 
       , ( 2, 2, 937 ) 
       , ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •