SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
The error is generated in this part of the file q2apro-onsitenotifications-layer.php;
private function getEventCount($last_visit, $userid)
{
$currentTime = (int)qa_opt('db_time');
$maxageTime = $currentTime - (int)qa_opt('q2apro_onsitenotifications_maxage') * 86400;
$fromTime = max($maxageTime, $last_visit);
$eventlogCount = qa_db_read_one_value(qa_db_query_sub(
'SELECT COUNT(event) FROM ^eventlog ' .
'WHERE datetime >= FROM_UNIXTIME(#) AND (' .
'(userid = # AND event LIKE "in_%") OR ' .
'(event IN ("u_message", "u_wall_post") AND params LIKE "userid=#\t%")' .
')',
$last_visit,
$userid,
$userid
));
$pluginCount = qa_db_read_one_value(qa_db_query_sub(
'SELECT COUNT(*) FROM ^q2apro_osn_plugin_notifications ' .
'WHERE user_id = # AND created_at >= FROM_UNIXTIME(#)',
$userid, $fromTime
));
return $eventlogCount + $pluginCount;
}
I've solved a few problems, but this one I'm stuck with. Has anyone else made it work?