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

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

c# - Why won't my code write to SQL? -

c# - Avoiding duplicate methods for Task and Task<T> -