I sense an easier way to do the code. How can I do the deletion/insertion shorter?
// to delete the old tags before inserting new tags
$result = pg_query_params ( $dbconn,
'DELETE FROM tags
WHERE question_id = $1',
array ( $question_id )
);
$result = pg_prepare ( $dbconn, "query_777",
'INSERT INTO tags
(tag, question_id)
VALUES ($1, $2)'
);