I have a huge problem with an sql query. I have been working on this now for about one week and cant get it solved.
The following query doesnot work, well, it does not cause and error but its not working how i want it to.
$query = "SELECT * FROM links WHERE (name LIKE '%" . $search . "%' OR link LIKE '%" . $search . "%' OR besch LIKE '%" . $search . "%' OR keyword LIKE '%" . $search . "%') AND (active = 1)";
So, this query is supposed to search in a database for a certain keyword. It works almost quite fine. Here are the problems: The query doesnot care wether active is one or anything else. Second: The query doesnot search in "besch". If the keyword is in "besch" and nowhere else the records doesnot get selected. Anyone an idea how to handle this?! I am getting really frustrated with this... I think I put all the ANDs and ORs in wrong order...
[This message has been edited by starspider (edited May 24, 2000).]