note 59503 rejected from function.substr by nlopess
| From: | nlopess@php.net | Date: | Thu, 08 Dec 2005 18:52:20 +0000 |
| Subject: | note 59503 rejected from function.substr by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-99770@lists.php.net to get a copy of this message | ||
Note Submitter: brad at BradTheissen dot com
----
I not new to programming, but fairly new to PHP (personally, however I have given many others the
tools to learn and program PHP for me in companies).
I need to do this:
In one of my Tables I have a field called 'stars' which contains any number of names,
comma delimited (e.g. MarilynMonroe, LizTaylor, JamesDean, SantaClaus)
I need to build a $query = 'select ... where stars (contains) one of those names... one at
a time, by comparing to a variable $starname which has ONE star's name (e.g.
$starname=JamesDean).
So i want to do the $query = 'select x x x where stars (contains) $starname
so that I will find all records where jamesDean is one of the names in the stars field for that
record.
Would that be a good use of the STR command on this page, or a different variation of STRxxx ???
Thank you... a direct e-mail response would be awesome as well. THANK YOU!