如何通过PHP从PostgreSQL数据库中选择最新3个问题的标题?
$result = pg_prepare($dbconn, "query1", "SELECT title FROM
questions ORDER BY was_sent_at_time
WHERE question_id = $1;");
$result = pg_execute($dbconn, "query1", array(7, 1, 9);
// Problem HERE, since I do not know how you can get the 3 newest questions
Run Code Online (Sandbox Code Playgroud)
在MySQL中它看起来像
SELECT title FROM questions ORDER BY was_sent_at_time DESC LIMIT 3;
Run Code Online (Sandbox Code Playgroud)
不确定它是否仍然适用而不改变Postgres.