When I want to change my admin preference, the following error appears. What does that mean?
Fatal Error:
lib/WikiDB/adodb/adodb-errorhandler.inc.php (In template 'body' < 'html'):76: Error: mysql error: [1062: Duplicate entry 'admin' for key 1] in EXECUTE("INSERT INTO pref (prefs,userid) VALUES ('a:2:{s:6:\"userid\";s:5:\"admin\";s:5:\"email\";s:17:\"my@email.com\";}','admin')")
*
lib/WikiUserNew.php (In template 'body' < 'html'):1725: Notice: fputs(): send of 6 bytes failed with errno=104 Connection reset by peer
Fatal PhpWiki Error
lib/WikiDB/adodb/adodb-errorhandler.inc.php (In template 'body' < 'html'):76: Error: mysql error: [1062: Duplicate entry 'admin' for key 1] in EXECUTE("INSERT INTO pref (prefs,userid) VALUES ('a:2:{s:6:\"userid\";s:5:\"admin\";s:5:\"email\";s:17:\"my@email.com\";}','admin')")
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just installed the latest version of phpwiki and am also getting this error when I try to change any preference. I am using it with MySQL and the sql statement in config.ini looks ok to me.
The relevant snippet from my config.ini is as follows.
DBAUTH_PREF_SELECT = "SELECT prefs FROM pref WHERE userid='$userid'"
; Update the user's preferences
DBAUTH_PREF_UPDATE = "UPDATE pref SET prefs='$pref_blob' WHERE userid='$userid'"
;DBAUTH_PREF_INSERT = "INSERT INTO pref (userid,prefs) VALUES ('$userid','$pref_blob')"
When I want to change my admin preference, the following error appears. What does that mean?
Fatal Error:
lib/WikiDB/adodb/adodb-errorhandler.inc.php (In template 'body' < 'html'):76: Error: mysql error: [1062: Duplicate entry 'admin' for key 1] in EXECUTE("INSERT INTO pref (prefs,userid) VALUES ('a:2:{s:6:\"userid\";s:5:\"admin\";s:5:\"email\";s:17:\"my@email.com\";}','admin')")
lib/WikiUserNew.php (In template 'body' < 'html'):1725: Notice: fputs(): send of 6 bytes failed with errno=104 Connection reset by peer
Fatal PhpWiki Error
lib/WikiDB/adodb/adodb-errorhandler.inc.php (In template 'body' < 'html'):76: Error: mysql error: [1062: Duplicate entry 'admin' for key 1] in EXECUTE("INSERT INTO pref (prefs,userid) VALUES ('a:2:{s:6:\"userid\";s:5:\"admin\";s:5:\"email\";s:17:\"my@email.com\";}','admin')")
Thanks in advance.
This means that you have a wrong SQL query which detects if a user exists.
This query which fails tries to add a new user, which already exists.
DBAUTH_PREF_SELECT
"SELECT prefs FROM pref WHERE userid='$userid'"
If a user exists it will use DBAUTH_PREF_UPDATE, not
DBAUTH_PREF_INSERT
Hi,
I just installed the latest version of phpwiki and am also getting this error when I try to change any preference. I am using it with MySQL and the sql statement in config.ini looks ok to me.
The relevant snippet from my config.ini is as follows.
DBAUTH_PREF_SELECT = "SELECT prefs FROM pref WHERE userid='$userid'"
; Update the user's preferences
DBAUTH_PREF_UPDATE = "UPDATE pref SET prefs='$pref_blob' WHERE userid='$userid'"
;DBAUTH_PREF_INSERT = "INSERT INTO pref (userid,prefs) VALUES ('$userid','$pref_blob')"
The exact error message is as follows:
lib/WikiDB/backend/PearDB.php (In template 'body' < 'html'):1059 Error: wikidb_backend_peardb_mysql: fatal database error
Can you provide some more suggestion on what I need to look for to solve this.
Thank you.
Vivek
Thanks for the reply.
So what should I do to avoid the error? I just logged in with my administrator account set in configure.ini and tried to add an email address to it.