[thelist] an array of values in a MySQL table?

Ron Thigpen rthigpen at nc.rr.com
Tue Mar 27 08:55:45 CST 2001


Why not use a simple join table (say issue_news_tbl)?  Define it with two fields:
your article news_tbl ID and issue_tbl ID.  Make the combination of these fields the
Primary Key for this table.  Pulling article ID's for a give issues is a simple
query:

SELECT from issue_news_tbl
WHERE news_id = thisNews_id

OR do a JOIN across the three tables.  

Doing this stores this data in such a way that you can use SQL to process it. 
Storing this in arrays (really, lists) ina text field means you would have to query
for that data, process the list, and then go back to the db for the articles.  Don't
work so hard, let the db do the lifting.

--ron thigpen 


phil wrote:

> Each news article may apply to one or more type of issue (as listed in
> issue_tbl) so I thought an array of values would work, but I'm not sure if
> it's possible, and if so, how to begin.
> 
> The issues are drawn from a separate table to allow new issues to be added
> and edited in the future, without affecting the news_tbl.
>




More information about the thelist mailing list