How can you solve the Resource ID #8 -error message in the following code?
The error apparently means that I have a bug in my SQL statement. However, I cannot see it.
$result = pg_prepare($dbconn, "query1", "SELECT user_id FROM users
WHERE email = $1;");
$result = pg_execute($dbconn, "query1", array("[email protected]"));
// to read the value
while ($row = pg_fetch_row($result)) {
$user_id = $row[0];
}
I get the error message when I try to echo $result
.