[PHP-DB] Compare a given value with multiple values field

2006-09-16 Thread Michael Gargiullo
Using 'like' is your best bet. With multiple condition, you could restrict the return set further. Is there a way to restructure your table? I don't know what the data represents, but you could use a field per list item( you could then index it t get very fast results). You could also use 'l

Re: [PHP-DB] Compare a given value with multiple values field

2006-09-16 Thread Hassan
I guess this is this closest, but apparently in this case if the "3" at the beginning doesn't exact, and even using LIKE '%3,%' (removing the first comma) would match an entry like 33, ! I need a better solution, does mysql have something similar to explode() in PHP? if it does, then how

Re: [PHP-DB] Compare a given value with multiple values field

2006-09-16 Thread Tom Atkinson
If you have the literal string "3,31,11,10" in a field in your table then you can 'search' for numbers in the string like this: SELECT * FROM table WHERE CONCAT(',', tablefield1, ',') LIKE '%,3,%' I don't know if it's the best way of doing it but it works for me. Natalie Leotta wrote: I'm not

Re: [PHP-DB] Compare a given value with multiple values field

2006-09-16 Thread Natalie Leotta
I'm not sure I understand your question, but my interpretation would be solved like this select * from table where variable in (select id from tablefield1) I hope this helps you!! Natalie On 9/16/06, Hassan <[EMAIL PROTECTED]> wrote: Hi My Best List, I have a field in a table contains "3,31,

[PHP-DB] Compare a given value with multiple values field

2006-09-16 Thread Hassan
Hi My Best List, I have a field in a table contains "3,31,11,10" (let say tablefield1) and I have a given value which I need to check if it exists in that list. I've tried: SELECT * FROM table WHERE 3 IN ( tablefield1 ); Any ideas? -

Re: FW: [PHP-DB] How to install PHP-DEV package for PDO_OCI

2006-09-16 Thread Tom Atkinson
It's in php-devel. To find out what package something is in you can ask yum # yum provides phpize and it will tell you php-devel.i386 5.1.4-1updates Matched from: /usr/bin/phpize /usr/lib/php/build/phpize.m4 Choy, Wai Yew wrote: Hi, Any kind soul o

FW: [PHP-DB] How to install PHP-DEV package for PDO_OCI

2006-09-16 Thread Choy, Wai Yew
Hi, Any kind soul out there can advise me? I've also try "yum install php5-dev" and "yum install php-dev"...All not valid.. Thanks. -Original Message- From: Choy, Wai Yew [mailto:[EMAIL PROTECTED] Sent: Fri 9/15/2006 10:25 AM To: [email protected] Subject: [PHP-DB] How to install