I am trying to bind a variable in this prepared statement, but i keep receiving the error:
Call to a member function bind_param() on a non-object The function is called, and variables are passed to it. When i change the function to just echo the variable, the variable prints on the page fine, but if i try to bind it here i receive the error. can anyone help?
//CALL FROM PAGE ONE check($username); //FUNCTION ON PAGE 2 function check($username){ $DBH = getDBH(); $qSelect = $DBH->prepare("SELECT * FROM users WHERE username = ?"); $qSelect->bind_param("s", $username); } i know the function is not completely written here, but that shouldn't be a problem. I don't understand why i am receiving this error.
var_dump($qSelect)to check if it is what you think it is.close(). Like$stmt.close();or$qSelect.close();PS.var_dump($qSelect);write nothing interesting, only true mysqli connection