From c88a3cd0cf77516cde31e7eb97560aa208949ec6 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Thu, 1 Jul 2010 13:04:56 +0200 Subject: [PATCH] INSERT may fail if the time is updated twice within the same second. Signed-off-by: Florent Bruneau --- include/banana/forum.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } -- 2.1.4