I have this small piece of code.
echo $token;
$selstmt=$conn->Prepare("SELECT UserID FROM USER WHERE Token LIKE ?");
$selstmt->bind_param('s', $token);
echo $token;
$selstmt->execute();
$selstmt->store_result();
$selstmt->bind_result($userid);
$selstmt->fetch();
echo $userid;
$selstmt->close();
If I remove the bind_param and directly insert the value in the prepare statement, the query works fine. I echo the value of token twice to check if the value is changed but the $token is same and the value is there. So why is this not working?
This may work for you, if you include the
%
signs