Reply to Re: Help with trick MySQL select problem

Your name:

Reply:


Posted by Jerry Stuckle on 05/26/05 07:45

Funnyweb wrote:
> I have a database table, which has field that could contain a single integer
> or a list of comma separated integers.
>
> Is it possible to match each row of that field against an array of integers
> and return those rows where any of the integers in that field are in my
> array?
>
> For example suppose I did the following:
>
> arInts = array(2,4,6,8,10);
>
> What I want to do is return all rows from my table where my field contains a
> single integer and it is in my array, or where my field contains a list of
> integers and any of those integers is in my array?
>
> Is this possible and if so how do I do it?
>
> Thanks
>
> Hamilton
>
>
>


Hamilton,

Try reading up on database normalization. Then create a link table with
two columns. First is the primary key of the original table, second is
a *single* integer. Multiple rows can have the same first column but
the second column would chance.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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