Commit 4b4df9e2 by pupi1985

Turned REPLACE statements into INSERT..ON DUPLICATE KEY UPDATE in db/points.php

parent 1001c774
...@@ -208,8 +208,13 @@ ...@@ -208,8 +208,13 @@
Update the cached count in the database of the number of rows in the userpoints table Update the cached count in the database of the number of rows in the userpoints table
*/ */
{ {
if (qa_should_update_counts()) if (qa_should_update_counts()) {
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_userpointscount', COUNT(*) FROM ^userpoints"); qa_db_query_sub(
"INSERT INTO ^options (title, content) " .
"SELECT 'cache_userpointscount', COUNT(*) FROM ^userpoints " .
"ON DUPLICATE KEY UPDATE content = VALUES(content)"
);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment