php - Strange prepared statements error -
here how statement looks like.
$stmt = $this->db->prepare(" select q.id questions q left outer join ( select max(chk_date) questions_last_chk_date last_check_date user_id = ? , chk_token=?) lcd on q.add_dt > lcd.questions_last_chk_date q.author_id<>? ") or die($this->db->error); $stmt->bind_param("isi", $_session["userid"], "q", $_session["userid"]) or die($stmt->error); i got 2 questions
1) getting error message
fatal error: cannot pass parameter 3 reference
why error occurs? btw, know last_check_date table empty think it's not related problem.
2) on windows, getting error message table last_check_date doesn't exist, 100% know there no typo, , table exists. tried same query navicat - db amanger application , got result. when try php getting error. on remote linux server works, , getting error message in question 1. tried restart mysql service, rename other name , change name previous. no success! how can fix problem?
you have put q variable.
fyi, try not use string values equals tables alias or references. passing value of q when have table q alias. not error, maybe confusing in case need echo of query.
Comments
Post a Comment