php - mysql query AND with OR not work -


in query want write logic , operation or . query not work.

select *  `data`  `city`='mycity'  , performdate='4'  , (curtime() >= `valid_from` or curtime() <= `valid_to`)  , perform_type='ptype' 

i think

(curtime() >=  `valid_from` or curtime() <= `valid_to`) 

this logic not work

untested ---

$time = curtime(); select * data city = 'mycity' , performdate = '4' , perform_type = 'ptype' , ($time >= 'valid_from' or $time <= 'valid to'); 

source: http://www.techonthenet.com/mysql/and_or.php


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -