编写以下查询的正确方法是什么?我得到一个错误
This is the error i get syntax error, unexpected 'm' (T_STRING), expecting ',' or ')'
这是我尝试的语法
$query
->select('id, user_name, user_email, objective_met')
->from($db->quoteName('logs_v2'))
->where($db->quoteName('userid') . ' = ' . $db->quote($m_id)
. ' AND ' . STR_TO_DATE(date,"%Y-%m-%d") . ' >= ' . STR_TO_DATE("' . date("m-d-Y",strtotime($clickeddate)) . '","%m-%d-%Y")
. ' AND ' . STR_TO_DATE(date,"%Y-%m-%d") . ' <= ' . STR_TO_DATE("' . date("m-d-Y",strtotime($clickeddate)) . '","%m-%d-%Y"));
m_id 是变量还是 m.id 错别字?
如果不工作 你应该尝试多个地方。
Where id=string
Where time1
Where time2
然后,如果不起作用,请在绑定字符串的地方尝试 Multiple。