From: Florent Bruneau Date: Thu, 1 Jul 2010 11:04:56 +0000 (+0200) Subject: INSERT may fail if the time is updated twice within the same second. X-Git-Tag: xorg/1.0.1~15^2~83 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c88a3cd0cf77516cde31e7eb97560aa208949ec6;p=platal.git INSERT may fail if the time is updated twice within the same second. Signed-off-by: Florent Bruneau --- diff --git a/include/banana/forum.inc.php b/include/banana/forum.inc.php index 0c54f45..6a6a869 100644 --- a/include/banana/forum.inc.php +++ b/include/banana/forum.inc.php @@ -131,8 +131,8 @@ class ForumsBanana extends Banana WHERE uid = {?}', $time, $this->user->id()); if (XDB::affectedRows() == 0) { - XDB::execute('INSERT INTO forum_profiles (uid, last_seen) - VALUES ({?}, FROM_UNIXTIME({?}))', + XDB::execute('INSERT IGNORE INTO forum_profiles (uid, last_seen) + VALUES ({?}, FROM_UNIXTIME({?}))', $this->user->id(), $time); } }