From: Reini U. <ru...@x-...> - 2004-08-05 15:42:55
|
John Cole schrieb: > Our main server is running MySQL 4.0.14 and our dev server is running > 4.0.20a. > > Should I add the auto_increment to the id column in the page table? Here is > my current schema for that table: > > CREATE TABLE `page` ( > `id` int(11) NOT NULL default '0', > `pagename` varchar(100) binary NOT NULL default '', > `hits` int(11) NOT NULL default '0', > `pagedata` mediumtext NOT NULL, > PRIMARY KEY (`id`), > UNIQUE KEY `pagename` (`pagename`) > ) TYPE=MyISAM; aha. yes, auto_increment is required for the latest ADODB backend. ?action=upgrade also tries to fix this issue. It is much faster then. > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Reini > Urban > Sent: Thursday, August 05, 2004 6:01 AM > To: php...@li... > Subject: Re: [Phpwiki-talk] Lot's of fatal php errors... > > > John Cole schrieb: > > >>I'm running the latests CVS code in a test directory on our live database, >>and I have been getting a LOT of database errors lately. >> >>Here is an example when saving a new page: >> >>Fatal PhpWiki Error >> >>lib\WikiDB\adodb\adodb-errorhandler.inc.php:76: Fatal[256]: mysql error: >>[1062: Duplicate entry '0' for key 1] in ADODB_Error_Handler(INSERT INTO >>page (pagename,hits) VALUES('jcole/test4',0), ) >> >>I seem to be getting a lot more errors when using SQL instead of ADODB. >>I'll start saving my error messages for both providers. > > > ADODB is the experimental one, and SQL (PearDB) the stable one. > > Your mysql page table does seem to have a working auto_increment for the > id column, which is not in the query. > Maybe we should use > "INSERT INTO page (id,pagename) VALUES(NULL,$pagename)" > to use an explicit NULL value, which obviously is not used implicitly, > but the number 0 instead. > I'll test that. > > Which mysql version? > > PS: I found recently some charset bugs/problems in recent windows mysql > versions, which need to be fixed also in phpwiki. > http://bugs.mysql.com/?id=4398 -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |