Make sure that you have some unique ID for each row of the main table in which you need this 'set'. Call this "mainUniqueID"
Create a new table, with a different uniqueID (this is optional, but I still like unique ID's on all my tables), "otherUniqueID", so that the columsn will be "otherUniqueID" (your index), "mainUniqueID" which will NOT be unique, and "yourData". For each item that is in your list for that mainUniqueID, you'll have a row in this second table.
To get the list, just "SELECT yourData FROM secondTable WHERE mainUniqueID=?". Other options are similar.
I know that some databases have SETs that you can use, but this is not necessarily reliable.
Optionally, you can always store the list as a string delimiated by characters you know will not be in it. If you have IPs, for example, you can easily convert these from 2^32 to ints, and the join ';' them. Mind you, these makes it a bit harder to select a specific IP out of a list.
In reply to Re: Yet Another Half Perl Half mySQL Question
by Masem
in thread Yet Another Half Perl Half mySQL Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |