You are here: Re: Storing array in a row « PHP Programming Language « IT news, forums, messages
Re: Storing array in a row

Posted by Rik on 05/11/06 11:59

guitarromantic@gmail.com wrote:
> Oops, just occured to me that I can't store a comma in an int field..
> changed to varchar, worked a charm, thanks!
>
> Do you think this approach is still viable for my site, though? If
> there's a more efficient/professional way, I'm interested.

An extra table would help to make the data more accessable.

TABLE reviews
review_id
some_other_fields

TABLE staff
staff_id
some_other_fields

TABLE staff_reviews
review_id
staff_id

That way cou can also keep the id's all integers, which would be a lot
faster then searching a varchar for a number that may or may nog be between
comma's.

To keep integrity intact I'd advice using InnoDB tables:
http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
Unless there is a lot of adding and deleting, then using InnoDB might slow
it down.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация