J
|
Jane 2/6/2007 |
Hi, function AfterSuccessfulRegistration() { //** Insert a record into another table **** global $conn; $strSQLInsert = "insert into TableName (Field1, Field2, Field3) values ('".$values["Field1"]."', '".$values["Field2"]."', '".$values["Field3"]."')"; db_exec($strSQLInsert,$conn); } |
I
|
ictaylor author 2/6/2007 |
Hi function AfterSuccessfulRegistration()
|
J
|
Jane 2/6/2007 |
Hi, function AfterSuccessfulRegistration() { //** Insert a record into another table **** global $conn; $strSQLInsert = "insert into phpbb1_users (username, user_password, user_email) values ('".$values["Username"]."', '".$values["Password"]."', '".$values["Email Address"]."')"; db_exec($strSQLInsert,$conn); } |
I
|
ictaylor author 2/6/2007 |
I am still getting an error using that above |
I
|
ictaylor author 2/6/2007 |
Do you think I need to send the 'ID Number' accross with the other info or am I clutching at straws? |
J
|
Jane 2/6/2007 |
Sorry for my fault. Here is the correct code: function AfterSuccessfulRegistration() { //** Insert a record into another table **** global $conn,$values; $strSQLInsert = "insert into phpbb1_users (username, user_password, user_email) values ('".$values["Username"]."', '".$values["Password"]."', '".$values["Email Address"]."')"; db_exec($strSQLInsert,$conn); } |
I
|
ictaylor author 2/6/2007 |
Hi Error type 256 Error description Duplicate entry '0' for key 1 URL www.boxedclever.net/users/register.php? Error file /home/b/o/boxedclever_net/users/include/dbconnection.php Error line 26 SQL query insert into `_users` (`Username`, `Password`, `Email Address`, `Date Of Birth`) values ('test', 'a07ea7137bcaf427f935bdbed8369eb8', 'test@test.co.uk', '01/01/1901') Solution It seems that you add duplicate key fields. Please check data you enter on the ADD or REGISTER page. |
J
|
Jane 2/7/2007 |
This error means that you add the record with duplicate primary key. You can do the following:
|
I
|
ictaylor author 2/7/2007 |
The _users table already has a primary INT key which is set to auto increment?? |
J
|
Jane 2/7/2007 |
Did you set up primary field as auto-increment in both tables? |
I
|
ictaylor author 2/7/2007 |
I have set up the _users table to auto increment using phprunner. The forum table phpbb1_users wasnt created in phprunner and phprunner doesnt give me the option to modify it. |
![]() |
Alexey admin 2/7/2007 |
Hi, |