visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: MySql :: MySQL datatype help! arrays...


By: Squibi U.S.A.  Date: 08/01/2003 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
Hey I'm trying to create a datatype of "array" in a MySQL database. To give an example I need something like -

create table my_table(option varchar(30) array[100]);

Where it creates an array of "option" variables (which is a string of length 30 characters) and the array size is 100.

Any help would be greatly appreciated, thanks
By: VGR Date: 09/01/2003 20:16:00 English  Type : Answer
no

the correct way to do this is a "relation" table

table1.ID -> table2.ID+stuff +table2.repeatedfield[0..100]

becomes

table1.ID -> table2.ID+stuff
table1.ID -> { table3.ID+repeatedfield }repeated less than or more than 100 times
By: TheFalklands Date: 09/01/2003 20:40:00 English  Type : Comment
Table is like unlimited array already :-)

CREATE TABLE table1
(
id int not null auto_increment primary key,
option varchar(30)
);

and place here so many records that you want.
id will be your unique index (like in array)

for ex. to take record with index = 2, run

Select option from table1 where id=2;



By: VGR Date: 09/01/2003 21:07:00 English  Type : Comment
that's exactly what I wrote ;-)

Do register to be able to answer

EContact
browser fav
page generated in 260.916950 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page