mysql-specificness :<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@545 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
@ -87,9 +87,8 @@ class NumericScore extends Extension {
|
||||
|
||||
private function add_vote($image_id, $user_id, $score) {
|
||||
global $database;
|
||||
// TODO: update if already voted
|
||||
$database->Execute(
|
||||
"INSERT INTO numeric_score_votes(image_id, user_id, score) VALUES(?, ?, ?)",
|
||||
"REPLACE INTO numeric_score_votes(image_id, user_id, score) VALUES(?, ?, ?)",
|
||||
array($image_id, $user_id, $score));
|
||||
$database->Execute(
|
||||
"UPDATE images SET numeric_score=(SELECT SUM(score) FROM numeric_score_votes WHERE image_id=?) WHERE id=?",
|
||||
|
Reference in New Issue
Block a user