This question is based on this topic .
Do you need explicit disinfection when using pg_prepare?
I feel that pg_prepare automatically sanitizes the user login, so we don’t need it
$question_id = filter_input(INPUT_GET, 'questions', FILTER_SANITIZE_NUMBER_INT);
The context in which I use Postgres
$result = pg_prepare($dbconn, "query9", "SELECT title, answer
FROM answers
WHERE questions_question_id = $1;");
$result = pg_execute($dbconn, "query9", array($_GET['question_id']));
source
share