If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > how to store 2d array in mysql table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-09, 09:31
eclipse3.4ide eclipse3.4ide is offline
Registered User
 
Join Date: Jan 2009
Posts: 3
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
Reply With Quote
  #2 (permalink)  
Old 02-02-09, 09:57
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Code:
CREATE TABLE my_2d_array
( x INTEGER NOT NULL 
, y INTEGER NOT NULL 
, PRIMARY KEY ( x , y )
, cellvalue INTEGER NOT NULL DEFAULT 0
);
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-04-09, 01:19
eclipse3.4ide eclipse3.4ide is offline
Registered User
 
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...
Reply With Quote
  #4 (permalink)  
Old 02-04-09, 06:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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 ) 
   , ...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On