我感覺一個更簡單的方法來執行代碼。我怎樣才能使刪除/插入更短?Postgres:插入和刪除
// 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)'
);
你的第二個查詢缺少的參數。 – 2009-09-03 21:03:23