Revert "INSERT ... RETURNING is well-supported now" - mysql doesn't...
This reverts commit 633d5c5348
.
This commit is contained in:
@ -626,12 +626,12 @@ class CommentList extends Extension
|
||||
if ($user->is_anonymous()) {
|
||||
$page->add_cookie("nocache", "Anonymous Commenter", time()+60*60*24, "/");
|
||||
}
|
||||
$cid = $database->get_one(
|
||||
"INSERT INTO comments(image_id, owner_id, owner_ip, posted, comment)
|
||||
VALUES(:image_id, :user_id, :remote_addr, now(), :comment)
|
||||
RETURNING id",
|
||||
$database->execute(
|
||||
"INSERT INTO comments(image_id, owner_id, owner_ip, posted, comment) ".
|
||||
"VALUES(:image_id, :user_id, :remote_addr, now(), :comment)",
|
||||
["image_id"=>$image_id, "user_id"=>$user->id, "remote_addr"=>get_real_ip(), "comment"=>$comment]
|
||||
);
|
||||
$cid = $database->get_last_insert_id('comments_id_seq');
|
||||
$snippet = substr($comment, 0, 100);
|
||||
$snippet = str_replace("\n", " ", $snippet);
|
||||
$snippet = str_replace("\r", " ", $snippet);
|
||||
|
Reference in New Issue
Block a user