Thursday 15 March 2012

mysqli query, LIKE and AND in the same query doesn't work out like it should -


Then this is my query, it does not matter if it is set to approved 0 or 1, then it will give me all the rows Anyway select 'from' tutorial where the tag like '% php%' or tag like 'php%' or '% php' tag or tag = 'php' and approved = 1 < / Pre>

I think that is the reason for this or I may be wrong, if someone can help me on this :)

Try brackets

  S Tags such as '*% FROM` tutorial' WHERE (such as tags like '% php%' or 'php%' or '% Php' or tag = 'php') and approved = 1  

No comments:

Post a Comment