Hi; I'm writing some php code for fulltext mysql searching. At last my code creates one sql query like SELECT * FROM jos_content WHERE ((LOWER(title) LIKE LOWER('%digital%') AND LOWER(title) LIKE LOWER('%point%')) OR (LOWER(introtext) LIKE LOWER('%digital%') AND LOWER(introtext) LIKE LOWER('%point%')) OR (LOWER(fulltext) LIKE LOWER('%digital%') AND LOWER(fulltext) LIKE LOWER('%point%'))) and sectionid=17 and catid=207 and state=1 LIMIT 0,25 PHP: It's the query when you search digital point. sectionid, catid, state, title, introtext and fulltext are the coloumns from my database. If I remove 'fulltext' coloumn from the query , everythink goes well but if I add it, It's giving error and code does not work. How can i solve this? Thanks for the comments
First off, remove all LOWER()s... SELECT queries are case-insensitive. And there's absolutely no reason to convert the column names to lower case. Then put backslashes around the word "fulltext", because it's a reserved keyword and if you have a column called like that it's confusing MySQL. SELECT * FROM table_name WHERE `fulltext` LIKE '%something%' .... Code (sql):