|
Posted by john doe on July 19, 2008, 8:12 am
Please log in for more thread options Paul Lautman wrote:
> john doe wrote:
>> john doe wrote:
>>> Hi All,
>>>
>>> I have the following query that works great...
>>>
>>> $result = mysql_query("SELECT * FROM location WHERE location_tag LIKE
>>> 'A___'")
>>> or die(mysql_error());
>>>
>>> I'm currently trying to change it over to something like..
>>>
>>> $result = mysql_query("SELECT * FROM location WHERE location_tag LIKE
>>> '$letter___'")
>>> or die(mysql_error());
>>>
>>> but I can't get the " escaping right!
>>>
>>> Any tips would be grand =)
>>>
>>> JD
>> Aha, solved it myself.
>>
>> For anyone searching I did this..
>>
>> $result = mysql_query("SELECT * FROM location WHERE location_tag LIKE
>> '".$letter."___'")
>>
>> On a side note, can anyone see anything I could maybe do better? I'm
>> searching the DB for codes in the form X123, as an example.
>>
>> JD
>
> Or try:
> $result = mysql_query("SELECT * FROM location WHERE location_tag LIKE
> '___'")
> or die(mysql_error());
>
>
Ahh, much neater! Cheers!
|