0

I'm having an issue with the prepared statement below:

$stmt = $mysqli->prepare("SELECT * FROM user_token WHERE token = ".$token."");
$stmt->bind_param('s', $token);
$stmt->execute();
$stmt->store_result();

If I run the following against the database, everything works fine and it returns the one row. I've tried to do a

var_dump($stmt);

and that returned:

bool(false)

So that means that the query is failing, but I'm really not sure why. Maybe someone could have a look and tell me where I'm going wrong with this.

P.S. There is a token in the database. The same token is in the URL. I get the token from the URL successfully. I tried echo and it displayed fine. Then I am just trying to retrieve the row that contains the token from URL from the database, but it's failing.

Thanks in advance.

Sergiu Tripon
  • 183
  • 2
  • 14

0 Answers0