I have a list of urls on my homepage that looks like SO in the following form
<a href="?questions&questions=777">link1</a>
<a href="?questions&questions=666">link2</a>
The following PHP script has a problem in the parameter $_GET.
$dbconn = pg_connect("host=localhost port=5432 dbname=masi user=masi password=123");
$result = pg_prepare($dbconn, "query9", "SELECT title, answer
FROM answers
WHERE questions_question_id = $1;");
$result = pg_execute($dbconn, "query9", array($_GET["'question_id' = $questions_question_id"]));
Thanks to Nose and Cihan for solving the problem with $ dbconn and for Simon to solve the main problem of this topic!
How can you only get question_id from the url so that Postgres understands the request?
source
share