Bug #74912 [Com]: PDO errorInfo 1062 Duplicate entry

From: Date: Thu, 21 Sep 2017 14:17:42 +0000
Subject: Bug #74912 [Com]: PDO errorInfo 1062 Duplicate entry
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211307@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74912&edit=1

 ID:                 74912
 Comment by:         serpens dot mors at gmail dot com
 Reported by:        marc dot w dot hagen at gmail dot com
 Summary:            PDO errorInfo 1062 Duplicate entry
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Debian 3.2.86-1 x86_64
 PHP Version:        5.6.31
 Block user comment: N
 Private report:     N

 New Comment:

"Duplicate entry 'php-rulez' for key 'PRIMARY'"

Look up this Link: https://dev.mysql.com/doc/refman/5.7/en/constraint-primary-key.html

If you are beginner in using SQL, take a look at this side: https://www.w3schools.com/sql/sql_primarykey.asp


Previous Comments:
------------------------------------------------------------------------
[2017-07-12 16:36:30] marc dot w dot hagen at gmail dot com

ah, can happen!

------------------------------------------------------------------------
[2017-07-12 16:33:37] martins dot teresko at gmail dot com

Ah, damn. Nevermind, I missed the error code :(

------------------------------------------------------------------------
[2017-07-12 16:30:14] martins dot teresko at gmail dot com

From the fine manual: 


"If you do not specify a list of column names for INSERT ... VALUES or INSERT ... SELECT,
values for every column in the table must be provided by the VALUES list or the SELECT statement. If
you do not know the order of the columns in the table, use DESCRIBE tbl_name to find out."

https://dev.mysql.com/doc/refman/5.7/en/insert.html

------------------------------------------------------------------------
[2017-07-12 16:22:45] marc dot w dot hagen at gmail dot com

Re: martins dot teresko at gmail dot com
Well more information is needed than that. As i see it this has nothing to do with SQL... This was a
MySQL database.

------------------------------------------------------------------------
[2017-07-12 16:11:11] martins dot teresko at gmail dot com

It's not a bug. You need to learn SQL.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=74912


--
Edit this bug report at https://bugs.php.net/bug.php?id=74912&edit=1


Thread (14 messages)

« previous php.bugs (#211307) next »