求帮助:Discuz数据库错误
求帮助:Discuz数据库错误,提示如下,怎么解决?望高手指点
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 63九年精发' , `atncontent`='NGC MS 63九年精发' , `atnprice`='100' , `bidtype`='2' , `atntype`='11' , `bidcount`='0' , `qprice`='100' , `aprice`='5000' , `rprice`='4000' , `baotui`='1' , `tradtype`='1' , `fareprice`='' , `atnshtime`='1375602243' , `ovtime`='1375623686' , `atnyear`='' , `mainpic`='201308/04/154233naqborezf54q64pv.jpg' , `viewtimes`='84' , `favtimes`='0' , `bidtimes`='13' , `status`='2' , `bidnew`='385' , `shfr`='0' , `shse`='0' , `inputtime`='1375602153'
PHP Debug
No. File Line Code
1 home.php 41 require_once(%s)
2 source/module/home/home_auction.php 64 require_once(%s)
3 source/include/auction/auction_bidden.php 68 table_auction_ovauctions->add_ovacution(Array)
4 source/class/table/table_auction_ovauctions.php 16 discuz_database::insert(%s, Array, %d)
5 source/class/discuz/discuz_database.php 60 discuz_database::query(%s, %s, %s, false)
6 source/class/discuz/discuz_database.php 136 db_driver_mysql->query(%s, %s, false)
7 source/class/db/db_driver_mysql.php 151 db_driver_mysql->halt(%s, %d, %s)
8 source/class/db/db_driver_mysql.php 218 break()
回复讨论(解决方案)
你这张表没有,主键(自动增长)
把主键ID设置为自动增长
那怎么在数据库后台设置主键自动增长?
明显是主键有相同的值,在这里也就是在插入`id`='4' 时,表里已经有id=4的值了,所以重复了,不知道你的业务是什么,如果id是其他表的主键关联的话,建议在建立一个无关的自增的主键,而关联的id仅仅是这个表一个的字段。如果id不是其他表的主键关联的话,就不要设定主键的id值。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Laravel's service container and service providers are fundamental to its architecture. This article explores service containers, details service provider creation, registration, and demonstrates practical usage with examples. We'll begin with an ove

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.
