Databases :: MySql :: MySQL datatype help! arrays... |
|||
| By: Squibi |
Date: 08/01/2003 00:00:00 |
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 | 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 | 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 | Type : Comment |
|
| that's exactly what I wrote ;-) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








