[Skip to main content](#vessel-content)

#   Duplicated customer entries for same joomla-user

##

- **[nuntius](/forum/user/29512-nuntius "View nuntius's Profile")**
- [![nuntius's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar29512.jpg)](/forum/user/29512-nuntius "View nuntius's Profile") Topic Author
- [ Offline](/forum/user/29512-nuntius)
- nuntius.nl

Less More

- Posts: 62
- Thank you received: 1
-
-
-
-

10 years 4 months ago [\#243011](#243011) by [nuntius](/forum/user/29512-nuntius "View nuntius's Profile")  *[Duplicated customer entries for same joomla-user](/forum/33-customers/885070-duplicated-customer-entries-for-same-joomla-user#243011 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.6 -- Browser(s) name and version -- : Chrome latest -- Error-message(debug-mod must be tuned on) -- : Duplicate database entries (no actual error)  Hello,  In my hikashop I suddenly have duplicate entries as customers for each Joomla User. I am not sure when it happened, but when a customer logged in he had to re-enter all his addresses. To check as to why that was I noticed all my customers where in the database twice.  In the database I dit this query to make sure I wasn't missing anything.  SELECT MIN(user&#95;id),MAX(user&#95;id), user&#95;email, user&#95;cms&#95;id, COUNT(&#42;) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1  And it showed 2 entries for each Joomla User.  Funny part is the new entries don't have any orders related to them. I checked with these queries: SELECT &#42; FROM cpgh15&#95;hikashop&#95;order WHERE order&#95;user&#95;id IN (SELECT MAX(user&#95;id) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1)  gives no result  and  SELECT &#42; FROM cpgh15&#95;hikashop&#95;order WHERE order&#95;user&#95;id IN (SELECT MIN(user&#95;id) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1)  gives the expected result of many orders.  First question is offcourse, is this a known problem, can I prevent it from occurring again? Second questions is, how can I fix this? Would deleting the duplicates suffice?  I would appreciate your assistance!  Kind regards, Teeuwis Hillebrand")* was created by *[nuntius](/forum/user/29512-nuntius "View nuntius's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.6
-- Browser(s) name and version -- : Chrome latest
-- Error-message(debug-mod must be tuned on) -- : Duplicate database entries (no actual error)

Hello,

In my hikashop I suddenly have duplicate entries as customers for each Joomla User. I am not sure when it happened, but when a customer logged in he had to re-enter all his addresses. To check as to why that was I noticed all my customers where in the database twice.

In the database I dit this query to make sure I wasn't missing anything.

SELECT MIN(user_id),MAX(user_id), user_email, user_cms_id, COUNT(*) FROM #__hikashop_user
GROUP BY user_cms_id
HAVING COUNT(*) &gt; 1

And it showed 2 entries for each Joomla User.

Funny part is the new entries don't have any orders related to them. I checked with these queries:
SELECT * FROM cpgh15_hikashop_order WHERE order_user_id IN (SELECT MAX(user_id) FROM #__hikashop_user
GROUP BY user_cms_id
HAVING COUNT(*) &gt; 1)

gives no result

and

SELECT * FROM cpgh15_hikashop_order WHERE order_user_id IN (SELECT MIN(user_id) FROM #__hikashop_user
GROUP BY user_cms_id
HAVING COUNT(*) &gt; 1)

gives the expected result of many orders.

First question is offcourse, is this a known problem, can I prevent it from occurring again?
Second questions is, how can I fix this? Would deleting the duplicates suffice?

I would appreciate your assistance!

Kind regards,
Teeuwis Hillebrand

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODUwNzAtZHVwbGljYXRlZC1jdXN0b21lci1lbnRyaWVzLWZvci1zYW1lLWpvb21sYS11c2VyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

10 years 4 months ago [\#243020](#243020) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Duplicated customer entries for same joomla-user](/forum/33-customers/885070-duplicated-customer-entries-for-same-joomla-user#243020 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.6 -- Browser(s) name and version -- : Chrome latest -- Error-message(debug-mod must be tuned on) -- : Duplicate database entries (no actual error)  Hello,  In my hikashop I suddenly have duplicate entries as customers for each Joomla User. I am not sure when it happened, but when a customer logged in he had to re-enter all his addresses. To check as to why that was I noticed all my customers where in the database twice.  In the database I dit this query to make sure I wasn't missing anything.  SELECT MIN(user&#95;id),MAX(user&#95;id), user&#95;email, user&#95;cms&#95;id, COUNT(&#42;) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1  And it showed 2 entries for each Joomla User.  Funny part is the new entries don't have any orders related to them. I checked with these queries: SELECT &#42; FROM cpgh15&#95;hikashop&#95;order WHERE order&#95;user&#95;id IN (SELECT MAX(user&#95;id) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1)  gives no result  and  SELECT &#42; FROM cpgh15&#95;hikashop&#95;order WHERE order&#95;user&#95;id IN (SELECT MIN(user&#95;id) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1)  gives the expected result of many orders.  First question is offcourse, is this a known problem, can I prevent it from occurring again? Second questions is, how can I fix this? Would deleting the duplicates suffice?  I would appreciate your assistance!  Kind regards, Teeuwis Hillebrand")*

Hi,

I've never seen that.
The user_email field of the hikashop_user table is a unique field. And the email field of the users table of Joomla is also a unique field.
And HikaShop automatically synch the user_cms_id and the user_email in the hikashop_user table based on the changes made in the users table of Joomla.
This means that if you have two entries with the same user_cms_id in the table, they must also have the same user_email value but that's not possible since there is a unique key on the column. So you should not be able to have two entries for the same user_cms_id.
The only reason would be that the database structure has been tempered with, or some custom coding somewhere messing with the user entries.
Check that you still have the HikaShop user synchronization plugin activated in the Joomla plugins manager.
Check that you still have the unique key on the user_email column of the hikashop_user table.
Deleting the duplicates should help, but if some other stuff handling the user synch has been modified, the problem could resurface.
I can only provide hints at what to check but since no one else had that problem and that it should not happen with a normal HikaShop and Joomla setup, I can't say much more to help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODUwNzAtZHVwbGljYXRlZC1jdXN0b21lci1lbnRyaWVzLWZvci1zYW1lLWpvb21sYS11c2VyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nuntius](/forum/user/29512-nuntius "View nuntius's Profile")**
- [![nuntius's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar29512.jpg)](/forum/user/29512-nuntius "View nuntius's Profile") Topic Author
- [ Offline](/forum/user/29512-nuntius)
- nuntius.nl

Less More

- Posts: 62
- Thank you received: 1
-
-
-
-

10 years 4 months ago [\#243042](#243042) by [nuntius](/forum/user/29512-nuntius "View nuntius's Profile")  Replied by *[nuntius](/forum/user/29512-nuntius "View nuntius's Profile")* on topic *[Duplicated customer entries for same joomla-user](/forum/33-customers/885070-duplicated-customer-entries-for-same-joomla-user#243042 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.1 -- PHP version -- : 5.6 -- Browser(s) name and version -- : Chrome latest -- Error-message(debug-mod must be tuned on) -- : Duplicate database entries (no actual error)  Hello,  In my hikashop I suddenly have duplicate entries as customers for each Joomla User. I am not sure when it happened, but when a customer logged in he had to re-enter all his addresses. To check as to why that was I noticed all my customers where in the database twice.  In the database I dit this query to make sure I wasn't missing anything.  SELECT MIN(user&#95;id),MAX(user&#95;id), user&#95;email, user&#95;cms&#95;id, COUNT(&#42;) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1  And it showed 2 entries for each Joomla User.  Funny part is the new entries don't have any orders related to them. I checked with these queries: SELECT &#42; FROM cpgh15&#95;hikashop&#95;order WHERE order&#95;user&#95;id IN (SELECT MAX(user&#95;id) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1)  gives no result  and  SELECT &#42; FROM cpgh15&#95;hikashop&#95;order WHERE order&#95;user&#95;id IN (SELECT MIN(user&#95;id) FROM #&#95;&#95;hikashop&#95;user GROUP BY user&#95;cms&#95;id HAVING COUNT(&#42;) &gt; 1)  gives the expected result of many orders.  First question is offcourse, is this a known problem, can I prevent it from occurring again? Second questions is, how can I fix this? Would deleting the duplicates suffice?  I would appreciate your assistance!  Kind regards, Teeuwis Hillebrand")*

Hi Nicolas,

It seems my database was a bit corrupt. In the structure it showed the two unique keys (user_cms_id and user_email) but I could manually insert a double easily.

I deleted all duplicates and then I removed the keys and re-added them, that made the table function normally again.

Thank you for the hints and tips!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODUwNzAtZHVwbGljYXRlZC1jdXN0b21lci1lbnRyaWVzLWZvci1zYW1lLWpvb21sYS11c2VyP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
