|
Posted by Gary L. Burnore on 07/16/07 00:04
On Mon, 16 Jul 2007 01:17:55 +0200, "Richard" <root@localhost> wrote:
>
><pnberry@gmail.com> wrote in message
>news:1184539579.012747.109870@o11g2000prd.googlegroups.com...
>> Hi,
>>
>> I'm trying to write a query using the mysql interface and I do not
>> know how to escape the parentheses I'm using in the query.
>>
>> Here's the query as I tested it in the mysql monitor and it works as
>> it should:
>>
>> SELECT * FROM tblCustomers WHERE InactiveFlag = "0" AND (FirstName
>> LIKE "%Paul%" or BusinessOrLastName LIKE "%Paul%" OR Id LIKE "%Paul
>> %") ORDER BY BusinessOrLastname;
>>
>> Here is what I've tried in my PHP script (the strings $inactive &
>> $search have the values "0" and "Paul" respectively):
>>
>> $result = mysql_query("SELECT * FROM tblCustomers WHERE InactiveFlag=
>> \"$inactive\"
>> AND \(FirstName LIKE \"%$search%\" OR BusinessOrLastName LIKE \"%
>> $search%\" OR Id LIKE \"%$search%\"\)
>> ORDER BY BusinessOrLastName",$db);
>>
>> I've attempted to escape the ()'s in the mysql_query() function with
>> backslashes \( and \) but it isn't working. I've read the PHP manual
>> about mysql_real_escape_string() but it's not clear if this will work
>> or how I would apply it.
>>
>> Any leads would be appreciated. Thanks, Paul
>
>
>Hi Paul,
>you dont need to escape the parenthesis.
Did you even read the rest of the thread before posting your "me too",
dick?
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================
Navigation:
[Reply to this message]
|