Database error when adding new user Database error when adding new user
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Database error when adding new user

Started by desrtfx, July 16, 2006, 09:10:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

desrtfx

Hi everybody!

Sorry, having to post another strange issue, but I can't find a solution.

I have moved the gallery to a new server.
The move went smoothly, all files are new version 1.4.8 and most is working fine.

The only problem is that everytime I try to add a new user to the DB, I get a "Critical Error"

I was able to track the code that generated the error in "usermgr.php", at line 817 ->
Quotecpg_db_query("INSERT INTO {$CONFIG['TABLE_USERS']}(user_regdate, user_active) VALUES (NOW(), 'YES')");

It seems that my server does not understand "NOW()"

The errormessage is as follows:
QuoteWhile executing query "INSERT INTO cpg148_users(user_regdate, user_active) VALUES (NOW(), 'YES')" on 0

mySQL error: Duplicate entry '' for key 2

Any ideas how I can get round the problem? Maybe change the function for the regdate?

below is the Server related debug info: (excerpt only)
VERSION INFO :
------------------
PHP version: 4.4.2 - OK
------------------
mySQL version: 5.0.21-standard
------------------
Coppermine version: 1.4.8(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support:
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 3.23.49
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /var/tmp/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.2.2
Linked Version 1.2.2.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M


Regards,
desrtfx (Georg)

Nibbler

Make sure the user_id field is auto_increment, check for users with no name.

desrtfx

Yes, the user_id field is auto_increment.

I had a record with an empty name, deleted it, tried again and another one with an empty name appeared.
Would it help if I change the default user name to some name instead of ''?

Regards,
desrtfx