KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: ejaen on October 30, 2009, 08:32:24 am

Title: Problem insert customer, duplicate email.
Post by: ejaen on October 30, 2009, 08:32:24 am
Hi, how do u do.
I have a problem when I try to insert a customer with email paco_joyero@hotmail.com because the app say me that the customer already exist in database.(Internal error. A customer with email address = paco_joyero@hotmail.com should not exist at this point in the method. Contact KonaKart support.)
I think's that the problem is because the app, look if the customer with this email exist like:

mysql> SELECT count(*)  FROM customers WHERE customers.customers_email_address LIKE '%paco_joyero@hotmail.com%';
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.01 sec)

But this email already not exist in database


mysql> SELECT customers.customers_email_address  FROM customers WHERE customers.customers_email_address LIKE '%paco_joyero@hotmail.com%';
+-------------------------+
| customers_email_address |
+-------------------------+
| paco.joyero@hotmail.com |
+-------------------------+
1 row in set (0.00 sec)

The query return other mail "paco.joyero@hotmail.com" , and the insert fail.
Please, can u help me? I'm lookig for a mysql bug in google and forum but i can't find nothing.

MySQL Version:mysqladmin  Ver 8.41 Distrib 5.0.51a, for debian-linux-gnu on i486

Thk's in advance
Emilio.
Title: Re: Problem insert customer, duplicate email.
Post by: ejaen on October 30, 2009, 01:15:24 pm
Hi,
the problem seem's that the "_" character is a especial character to mysql, is not a bug.
http://dev.mysql.com/doc/refman/5.0/en/pattern-matching.html
And then , the problem is konakart make a "like" query to determine if the email exist's in database.
I use Konakart 3.2 version.
I'm wrong?
Thk's in advance
Title: Re: Problem insert customer, duplicate email.
Post by: greg on November 02, 2009, 05:38:49 pm
You are right that a like query is done there. 

This is not the case from the store-front application we provide where an equals query is executed... so you can always create your customers that way when you have a clash with the like query.

The code has been modified for the next release but there are a few workarounds you can use including:


Title: Re: Problem insert customer, duplicate email.
Post by: ejaen on November 03, 2009, 03:51:00 pm
Hi, thk's for u answer
I use admin app because  we make  a script to load customers and i think that i must use admin app in "batch" mode.
I change my script to use app and register customer.
Thk's for u time greg.