php - How can I assign one part of the WHERE clause to multiple other parts of it? -


i make mysql query like: select * title '%".$_post["search"]."%' or '%".$_post["search"]."%' , costs < '".$max."'

this give me results title search , results search , costs smaller $max. want costs < $max title $search. dont want put costs < $max 2 times script. there way assign both? maybe brackets: where (title '%".$_post["search"]."%' or '%".$_post["search"]."%') , costs < '".$max."'

how can achieve this?

thank you! phpheini

yes, can use parentheses or evaluated first:

where (title '%foo%' or '%foo%') , costs < '20' 

other remarks:


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -