[RSS Feed/News] XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
How can I prevent server errors like this:

XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry

I have the following code:

PHP:

Code:
if (empty($forumListCount))
{
	$forumListCount = \XF::em()->create('Andy\ForumListCount:ForumListCount');
	$forumListCount->count_date = $today;
	$forumListCount->count_guest = 0;
	$forumListCount->count_member = 0;
	$forumListCount->count_robot = 0;
	$forumListCount->save();
}

The server error only occurs once in a...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom