Strange PHP PDO MySQL Error
Go to solution
Solved by Eigenvektor,
What language (PHP, I assume) and/or library is this? I would assume
$query->execute([$gid]);
to return some form of result object, so you'd have to use that to fetch your results? Similar to this:
$statement = $db->prepare('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC'); $exec = $statement->execute([$_GET['blogpostid']]); $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
The error implies that "$query" is a boolean value, which is why you can't call "fetch" on it.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now