我正在使用select数据,其中今天是startdate和enddate之间的日期。但我所尝试的不是工作。有人可以给我一些解决方案吗?
这就是我的尝试:
$stmt = "SELECT tbl1.* FROM "._CONST_TBL_VOTE." tbl1, "._CONST_TBL_VOTE_ANSWER." tbl2" ;
$stmt .= " WHERE ".$date." BETWEEN tbl1.publishing_startdate AND tbl1.publishing_enddate";
答案 0 :(得分:1)
尝试添加''围绕$ date变量,如
$stmt = "SELECT tbl1.* FROM "._CONST_TBL_VOTE." tbl1, "._CONST_TBL_VOTE_ANSWER." tbl2" ;
$stmt .= " WHERE '".$date."' BETWEEN tbl1.publishing_startdate AND tbl1.publishing_enddate";