Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Odd mysql/php behavior with LIKE clause
August 16, 2006, 2:37 pm
rate this thread
SELECT rownum from(SELECT @rownum:=@rownum+1 rownum, t.*FROM (SELECT
FROM application_list_1.application_data_table a ORDER BY Application
asc ) t) s
WHERE Application like '$app%' order by Application asc limit 1
where $app is my search query passed in from an html form. This query
is run in a PHP script. I run it with the following code:
$row = mysql_fetch_assoc($sql);
This works 100% fine EXCEPT when I pass 'a' or 'A' to the query from
the html form. Every other letter or string works just fine except the
'a' or 'A'. Also, I can run this query within MySQL query browser with
'a' or 'A' and get valid results.
I'm totally confused. What is the problem with the 'a'? Encoding?
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum