Ask for help: Discuz database error
Ask for help: Discuz database error, prompt as follows, how to solve? Looking for expert guidance
discuz! Database Error
(1062) Duplicate entry ' 4 ' for key ' PRIMARY '
INSERT into auction_ovauctions SET ' id ' = ' 4 ', ' uid ' = ' 4 ', ' atnnum ' = ' atn_201308041542338676 ', ' atntitle ' = ' NGC MS 639-year fine hair ', ' Atncontent ' = ' NGC MS 639 ', ' atnprice ' = ' + ', ' bidtype ' = ' 2 ', ' atntype ' = ' one ', ' bidcount ' = ' 0 ', ' qprice ' = ' April ', ' Apr Ice ' = ', ' rprice ' = ' 4000 ', ' baotui ' = ' 1 ', ' tradtype ' = ' 1 ', ' fareprice ' = ', ' atnshtime ' = ' 1375602243 ', ' ovtime ' = ' 1375 623686 ', ' atnyear ' = ', ' mainpic ' = ' 201308/04/154233naqborezf54q64pv.jpg ', ' viewtimes ' = ' a ', ' favtimes ' = ' 0 ', ' Bidtimes ' = ', ' status ' = ' 2 ', ' bidnew ' = ' 385 ', ' shfr ' = ' 0 ', ' shse ' = ' 0 ', ' inputtime ' = ' 1375602153 '
PHP Debug
No.filelinecode
1home.php41require_once (%s)
2source/module/home/home_auction.php64require_once (%s)
3source/include/auction/auction_bidden.php68table_auction_ovauctions->add_ovacution (Array)
4source/class/table/table_auction_ovauctions.php16discuz_database::insert (%s, Array,%d)
5source/class/discuz/discuz_database.php60discuz_database::query (%s,%s,%s, false)
6source/class/discuz/discuz_database.php136db_driver_mysql->query (%s,%s, false)
7source/class/db/db_driver_mysql.php151db_driver_mysql->halt (%s,%d,%s)
8source/class/db/db_driver_mysql.php218break ()
Share to:
------Solution--------------------
You don't have this watch, primary key (autogrow)
Set the primary key ID to autogrow
------Solution--------------------
Obviously the primary key has the same value, in this case, when inserting ' id ' = ' 4 ', the table already has the value of id=4, so repeat, do not know what your business is, if the ID is the primary key association of other tables, it is recommended to establish an unrelated self-increment of the primary key, and the associated ID is only one field of the If the ID is not a primary key association for another table, do not set the ID value of the primary key.