[SOLVED] Registration add a record to another table then update user |
4/3/2024 8:04:17 PM |
PHPRunner General questions | |
A
asawyer13 authorDevClub member
I have this code in the After Succesful Registration $data = array(); What I am trying to do is insert a record into the Accounts table which seems to work. Then I am trying to update the user record with that AccountID. What I'm getting is no AccountID in the Users record when it completes the registration. Can someone tell me a better way or tell me what I'm doing wrong? Thanks |
|
A
|
asawyer13 authorDevClub member 4/3/2024 |
I have confirmed that it is getting the lastid correctly. So it seems like the issue is in the update statement for users. I'm going to try to confirm that the UserID is valid. Alan |
A
|
asawyer13 authorDevClub member 4/3/2024 |
It appears that the $userdata["UserID"] field is blank. The column in the database for sure is called UserID, so I don't exactly know what I'm doing wrong. Alan |
A
|
asawyer13 authorDevClub member 4/3/2024 |
The manual says: It's saying user-entered data so |
![]() |
Sergey Kornilov admin 4/4/2024 |
$userdata["UserID"] will be empty if UserID is not entered by user manually as a part of the form. Maybe you can retrive this UserID from Users table using something else that user entered, like their email address. Or you can get the maximum value of UserID column in Users table if UserID is an auto-increment. |