SQL with LIKE

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
aniketto
Forum Newbie
Posts: 1
Joined: Mon Dec 01, 2008 10:14 pm

SQL with LIKE

Post by aniketto »

Hi all,
I am developing a php application which needs use of SQL. In SQL query I have to use 'LIKE' construct.
Currently my query is like
$select->from(array('m' => 'mail_delivery'),
array('mail_subject', 'delivery_date'))
->join(array('u' =>' user'),
'm.delivery_user_id = u.id',
array('id','user_name'))
->where("m.mail_subject like '%?%'", $criteria['mail_subject'],
'u.user_name like \'%?%\'", $criteria['delivery_user_name']);

I am getting syntax error near like. Can anybody tell me what is correct syntax to use like construct.
Thanks in advance.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Re: SQL with LIKE

Post by jmut »

Is this using Zend Framework or is just me? Cause topic is kinda misleading I think your problem is particular with ZF
Post Reply