Hi I am trying to SELECT id from user WHERE $_SESSION[‘uid’] using PDO. I got a
Catchable fatal error: Object of class PDOStatement could not be converted to string. I have a feeling I am setting it wrong, can someone please show me the proper format? Thanks in advance.
[php]$sessionid = $_SESSION[‘uid’];
$id = $conn->prepare(“SELECT id
FROM user
WHERE id = :sessionid”);
$id ->bindParam(’:sessionid’, $sessionid, PDO::PARAM_INT);
$id->execute();
[/php]