You need to use wildcards
On Nov 5, 2010 5:55 PM, "xpanshun" <[email protected]> wrote:
Hi everyone,
I am trying to return any record from the database where a certain
word (stored in variable $searchterm) is used (within a few different
fields)...
Here is what I have:
$q = Doctrine_Query::create()
->from('Product p')
->where('p.product_id = ?', $search_term)
->orWhere('p.product_full_desc LIKE ?', $search_term)
->orWhere('p.product_partial_desc LIKE ?', $search_term)
->orWhere('p.product_type = ?', $search_term);
$result_array_searchresults = $q->fetchArray();
However the only field that I can get a return from is a one-word
field like 'bracelet'. Fields like 'product_full_desc' or
'product_partial_desc' that contain strings/sentences won't return
anything. I want the query to be able to read through these strings
and pick out the search term.
What is wrong with my query? How can I achieve the result I want?
Thanks!
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]<symfony-users%[email protected]>
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en