This is my current PHP code:
$sql = 'SELECT * from comments where post_id_fk=$post_id';
$users = $db->prepare($sql);
$users->execute();
while($row = pg_fetch_array($users, 0, PGSQL_ASSOC))
For some reason, I keep getting the following error:
Warning: pg_fetch_array() expects parameter 1 to be resource, object given in /home/se212004/public_html/content.html on line 39`
The line number refers to the line with the while loop. I have tried to fix it several times, but I cannot get it to work.
pg_result_error()to see what it is.