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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -