sql - How to select data from database where today date between startdate and enddate? -


i working select data today date between startdate , enddate. have tried not work. can give me solution on it?

this have tried :

$stmt = "select tbl1.* "._const_tbl_vote." tbl1, "._const_tbl_vote_answer." tbl2" ; $stmt .= " ".$date." between tbl1.publishing_startdate , tbl1.publishing_enddate"; 

try adding '' around $date variable like

$stmt = "select tbl1.* "._const_tbl_vote." tbl1, "._const_tbl_vote_answer." tbl2" ; $stmt .= " '".$date."' between tbl1.publishing_startdate , tbl1.publishing_enddate"; 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -