I've been staring over this code for quite awhile now and I can't seem to get it to work at all, I have a prepared statement as follow
$stmt = $conn->prepare('SELECT * FROM Session WHERE SessionId = :sessionID');
$stmt->bindParam(':sessionID',$sessionID);
$stmt->execute();
$session = $stmt->fetch();
I have tried various things such as putting single quotes around the ':sessionID' and that prevents the syntax error but leads to nothing being taken from the database. I have ran many of these queries in the database on PHPMyAdmin and they run perfectly fine, I even have tried the generated PHP code from PHPMyAdmin but that produced syntax errors as well. I also tried PDO::PARAM_STR
and that didn't make any changes. I'm not sure what else to try at this point, I'm running PHP 7.0.28 if that helps. The error is '* FROM Session WHERE SessionId='5ac81e5ab16089.68567115''