0

Hallo,

I am trying to fix my mysql search query:

 $data = mysql_query("SELECT * FROM static_content WHERE upper(image) or upper(title) or upper(content) LIKE'%$find%'"); 

Please help me to fix it. Is it correct?

I mean where column image (change to upper case) or column title (change to upper case) or column content (change to upper case) like the data that I input in the search box (the code before it already change it to uppercase).

2
Contributors
6
Replies
33
Views
3 Years
Discussion Span
Last Post by davy_yg
0

I read the guide, I still do not understand how to apply it to my query. I guess I just use this one:

 $data = mysql_query("SELECT * FROM static_content WHERE upper(image) LIKE'%$find%' or upper(title) LIKE'%$find%' or upper(content) LIKE'%$find%'"); 

Is that correct?

Edited by davy_yg

0

Is that correct?

Yes.

Apart from that. In most cases comparisons in queries are case-insensitive, so you could probably do without UPPER()

Edited by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.