error while creating new article content: Duplicate entry '0

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
rushnikus
Posts: 8
Joined: Sat 21. Apr 2007, 07:00
Location: Ukraine

error while creating new article content: Duplicate entry '0

Post by rushnikus »

Does anyone know what is the cause for this problem?
error while creating new article content: Duplicate entry '0' for key 1
After I submit a new artical it happens. Then cannot log in unless restore the artical content table in database.

Thanks!

Rushnik
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

seems that your DB has lost the 'auto increment' on some Tables !?
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
rushnikus
Posts: 8
Joined: Sat 21. Apr 2007, 07:00
Location: Ukraine

Post by rushnikus »

Yes, I thought maybe this problem, but I never change it in database. And then I change to another database from the time when it is working, but even this one cannot work.

Also, I didnt change anything for the database at all, everything is through backend when this problem happen the first tiem.

Can it be some setting for the MySQL? Maybe in webhosting change it?

Edit: OK, I check my DB, I did not have auto increment anywehere, its so strange because never edit the database directly before. now, I add this fixed this, but still have the problem.

here is my table:
DROP TABLE IF EXISTS phpwcms_article;
CREATE TABLE phpwcms_article (
article_id int(11) NOT NULL default '0',
article_cid int(11) NOT NULL default '0',
article_tid int(11) NOT NULL default '0',
article_uid int(11) NOT NULL default '0',
article_tstamp timestamp(14) NOT NULL,
article_username varchar(125) NOT NULL default '',
article_title text NOT NULL,
article_keyword text NOT NULL,
article_public int(1) NOT NULL default '0',
article_deleted int(1) NOT NULL default '0',
article_begin datetime NOT NULL default '0000-00-00 00:00:00',
article_end datetime NOT NULL default '0000-00-00 00:00:00',
article_aktiv int(1) NOT NULL default '0',
article_subtitle text NOT NULL,
article_summary text NOT NULL,
article_redirect text NOT NULL,
article_sort int(11) NOT NULL default '0',
article_notitle int(1) NOT NULL default '0',
article_hidesummary int(1) NOT NULL default '0',
article_image blob NOT NULL,
article_created varchar(14) NOT NULL default '',
article_cache varchar(10) NOT NULL default '0',
article_nosearch char(1) NOT NULL default '0',
article_nositemap int(1) NOT NULL default '0',
article_aliasid int(11) NOT NULL default '0',
article_headerdata int(1) NOT NULL default '0',
article_morelink int(1) NOT NULL default '1',
article_pagetitle varchar(255) NOT NULL default '',
article_paginate int(1) NOT NULL default '0',
article_serialized blob NOT NULL,
PRIMARY KEY (article_id),
KEY article_aktiv (article_aktiv),
KEY article_public (article_public),
KEY article_deleted (article_deleted),
KEY article_nosearch (article_nosearch),
KEY article_begin (article_begin),
KEY article_end (article_end),
KEY article_cid (article_cid),
KEY article_tstamp (article_tstamp)
) TYPE=MyISAM AUTO_INCREMENT=30 ;
DROP TABLE IF EXISTS phpwcms_articlecat;
CREATE TABLE phpwcms_articlecat (
acat_id int(11) NOT NULL default '0',
acat_name text NOT NULL,
acat_info text NOT NULL,
acat_public int(1) NOT NULL default '0',
acat_tstamp timestamp(14) NOT NULL,
acat_aktiv int(1) NOT NULL default '0',
acat_uid int(11) NOT NULL default '0',
acat_trash int(1) NOT NULL default '0',
acat_struct int(11) NOT NULL default '0',
acat_sort int(11) NOT NULL default '0',
acat_alias text NOT NULL,
acat_hidden int(1) NOT NULL default '0',
acat_template int(11) NOT NULL default '0',
acat_ssl int(1) NOT NULL default '0',
acat_regonly int(1) NOT NULL default '0',
acat_topcount int(11) NOT NULL default '0',
acat_redirect text NOT NULL,
acat_order int(2) NOT NULL default '0',
acat_cache varchar(10) NOT NULL default '',
acat_nosearch char(1) NOT NULL default '',
acat_nositemap int(1) NOT NULL default '0',
acat_permit text NOT NULL,
acat_maxlist int(11) NOT NULL default '0',
acat_cntpart varchar(255) NOT NULL default '',
acat_pagetitle varchar(255) NOT NULL default '',
acat_paginate int(1) NOT NULL default '0',
PRIMARY KEY (acat_id),
KEY acat_struct (acat_struct),
KEY acat_sort (acat_sort),
FULLTEXT KEY acat_alias (acat_alias)
) TYPE=MyISAM AUTO_INCREMENT=30 ;
DROP TABLE IF EXISTS phpwcms_articlecontent;
CREATE TABLE phpwcms_articlecontent (
acontent_id int(11) NOT NULL default '0',
acontent_aid int(11) NOT NULL default '0',
acontent_uid int(11) NOT NULL default '0',
acontent_created timestamp(14) NOT NULL,
acontent_tstamp timestamp(14) NOT NULL default '00000000000000',
acontent_title text NOT NULL,
acontent_text text NOT NULL,
acontent_type int(10) NOT NULL default '0',
acontent_sorting int(11) NOT NULL default '0',
acontent_image text NOT NULL,
acontent_files text NOT NULL,
acontent_visible int(1) NOT NULL default '0',
acontent_subtitle text NOT NULL,
acontent_before varchar(10) NOT NULL default '',
acontent_after varchar(10) NOT NULL default '',
acontent_top int(1) NOT NULL default '0',
acontent_redirect text NOT NULL,
acontent_html text NOT NULL,
acontent_trash int(1) NOT NULL default '0',
acontent_alink text NOT NULL,
acontent_media text NOT NULL,
acontent_form mediumtext NOT NULL,
acontent_newsletter mediumtext NOT NULL,
acontent_block varchar(200) NOT NULL default '0',
acontent_anchor int(1) NOT NULL default '0',
acontent_template varchar(255) NOT NULL default '',
acontent_spacer int(1) NOT NULL default '0',
acontent_tid int(11) NOT NULL default '0',
acontent_livedate datetime NOT NULL default '0000-00-00 00:00:00',
acontent_killdate datetime NOT NULL default '0000-00-00 00:00:00',
acontent_module varchar(255) NOT NULL default '',
PRIMARY KEY (acontent_id),
KEY acontent_aid (acontent_aid),
KEY acontent_sorting (acontent_sorting),
KEY acontent_type (acontent_type),
KEY acontent_livedate (acontent_livedate,acontent_killdate)
) TYPE=MyISAM AUTO_INCREMENT=47 ;
I using the MySQL:
MySQL client version: 4.1.10
Server version: 4.0.27-standard

Here is system de variable:
Variable Session value / Global value
back log 50
basedir /
binlog cache size 32,768
bulk insert buffer size 8,388,608
character set latin1
character sets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5
concurrent insert ON
connect timeout 10
convert character set
datadir /var/lib/mysql/
default week format 0
delay key write ON
delayed insert limit 100
delayed insert timeout 300
delayed queue size 1,000
flush OFF
flush time 0
ft boolean syntax + -><()~*:""&|
ft max word len 254
ft max word len for sort 20
ft min word len 4
ft stopword file (built-in)
have bdb NO
have crypt YES
have innodb DISABLED
have isam YES
have openssl NO
have query cache YES
have raid NO
have symlink YES
init file
innodb additional mem pool size 1,048,576
innodb autoextend increment 8
innodb buffer pool size 8,388,608
innodb data file path
innodb data home dir
innodb fast shutdown ON
innodb file io threads 4
innodb flush log at trx commit 1
innodb flush method
innodb force recovery 0
innodb lock wait timeout 50
innodb log arch dir
innodb log archive OFF
innodb log buffer size 1,048,576
innodb log file size 5,242,880
innodb log files in group 2
innodb log group home dir
innodb max dirty pages pct 90
innodb max purge lag 0
innodb mirrored log groups 1
innodb table locks ON
innodb thread concurrency 8
interactive timeout 10
join buffer size 1,044,480
key buffer size 16,777,216
language /usr/share/mysql/english/
large files support ON
license GPL
local infile ON
locked in memory OFF
log OFF
log bin OFF
log error
log slave updates OFF
log slow queries OFF
log update OFF
log warnings 1
long query time 10
low priority updates OFF
lower case file system OFF
lower case table names 0
max allowed packet 16,776,192
max binlog cache size 4,294,967,295
max binlog size 1,073,741,824
max connect errors 10
max connections 500
max delayed threads 20
max heap table size 16,777,216
max insert delayed threads 20
max join size 4,294,967,295
max relay log size 0
max seeks for key 4,294,967,295
max sort length 1,024
max tmp tables 32
max user connections 25
max write lock count 4,294,967,295
myisam max extra sort file size 268,435,456
myisam max sort file size 2,147,483,647
myisam recover options OFF
myisam repair threads 1
myisam sort buffer size 67,108,864
net buffer length 16,384
net read timeout 30
net retry count 10
net write timeout 60
new OFF
open files limit 2,558
pid file /var/lib/mysql/goldzulu.takethishost.net.pid
port 3,306
protocol version 10
query alloc block size 8,192
query cache limit 1,048,576
query cache size 33,554,432
query cache type ON
query cache wlock invalidate OFF
query prealloc size 8,192
range alloc block size 2,048
read buffer size 2,093,056
read only OFF
read rnd buffer size 262,144
rpl recovery rank 0
server id 1
skip external locking ON
skip networking OFF
skip show database OFF
slave net timeout 3,600
slow launch time 2
socket /var/lib/mysql/mysql.sock
sort buffer size 2,097,144
sql mode 0
table cache 1,024
table type MYISAM
thread cache size 128
thread stack 196,608
timezone EST
tmp table size 33,554,432
tmpdir /tmp/
transaction alloc block size 8,192
transaction prealloc size 4,096
tx isolation REPEATABLE-READ
version 4.0.27-standard
version comment Official MySQL RPM
version compile os pc-linux-gnu
wait timeout 10
Thanks for the help, really dying now!
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

mhhh

try this

Code: Select all

ALTER TABLE `#__phpwcms_address` CHANGE `address_id` `address_id` int(11) NOT NULL auto_increment ;
ALTER TABLE `#__phpwcms_article` CHANGE `article_id` `article_id` int(11) NOT NULL auto_increment ;
ALTER TABLE `#__phpwcms_articlecat` CHANGE `acat_id` `acat_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_articlecontent` CHANGE `acontent_id` `acontent_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_bad_behavior` CHANGE `id` `id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_bid` CHANGE `bid_id` `bid_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_blog` CHANGE `blog_id` `blog_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_cache` CHANGE `cache_id` `cache_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_chat` CHANGE `chat_id` `chat_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_country` CHANGE `country_id` `country_id` int(4) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_file` CHANGE `f_id` `f_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_filecat` CHANGE `fcat_id` `fcat_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_filekey` CHANGE `fkey_id` `fkey_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_fonts` CHANGE `font_id` `font_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_fonts_colors` CHANGE `color_id` `color_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_fonts_styles` CHANGE `style_id` `style_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_formresult` CHANGE `formresult_id` `formresult_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_formtracking` CHANGE `formtracking_id` `formtracking_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_forum` CHANGE `forum_id` `forum_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_guestbook` CHANGE `guestbook_id` `guestbook_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_imgcache` CHANGE `imgcache_id` `imgcache_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_keyword` CHANGE `keyword_id` `keyword_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_log` CHANGE `log_id` `log_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_map` CHANGE `map_id` `map_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_message` CHANGE `msg_id` `msg_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_module` CHANGE `module_id` `module_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_newsletter` CHANGE `newsletter_id` `newsletter_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_newsletterqueue` CHANGE `queue_id` `queue_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_pagelayout` CHANGE `pagelayout_id` `pagelayout_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_profession` CHANGE `prof_id` `prof_id` int(4) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_subscription` CHANGE `subscription_id` `subscription_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_template` CHANGE `template_id` `template_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_user` CHANGE `usr_id` `usr_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_userdetail` CHANGE `detail_id` `detail_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_usergroup` CHANGE `group_id` `group_id` int(11) NOT NULL auto_increment;
ALTER TABLE `#__phpwcms_userlog` CHANGE `userlog_id` `userlog_id` int(11) NOT NULL auto_increment;
where #__ is a Placeholder for Tableprefix - you must edit this to your Prefix - if you don't have a Tableprefix than change/remove it to ALTER TABLE 'phpwcms_.......

hope I got all Tables !?
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Post Reply