[SOLVED] Insert record in another table after registration |
4/6/2022 10:34:53 AM |
PHPRunner General questions | |
A
alfonso authorDevClub member
I want to insert a record into a table after the record is committed. If I add a fixed value in a field everything is correct. But I want to add the ID or the values of the records table and I can't do it with this code. It seems that it does not correctly collect the fields of the registry table This code works fine But if I want to insert ID value or ID session I don't get: function AfterSuccessfulRegistration(&$userdata, $pageObject) I also try this: $_SESSION["ID1"] = $data["ID"]; $data = array(); Any idea .Thanks |
|
![]() |
Sergey Kornilov admin 4/7/2022 |
Instead of your code in AfterSuccessfulLogin event use the following: Let us know what it prints. |
A
|
alfonso authorDevClub member 4/7/2022 |
I get this: |
A
|
alfonso authorDevClub member 4/7/2022 |
With this code I get to insert record: $data2 = array(); but I need to insert ID session or ID field from jobusers table. This is the table I use to register |
![]() |
Sergey Kornilov admin 4/7/2022 |
It apepars that your ID field is not available in $userdata array. This may happen for a couple of reasons.
|
A
|
alfonso authorDevClub member 4/8/2022 |
If I add the ID field from the jobusers table to the register form then it works. |
![]() |
Sergey Kornilov admin 4/8/2022 |
In this case, I guess that you can perform a SQL select from the login table based on the username for instance, and retrieve new ID this way. |
A
|
alfonso authorDevClub member 4/11/2022 |
Thanks. How can I see session ID? Or save it in a field? |
A
|
alfonso authorDevClub member 4/13/2022 |
I've got it with this code: $data2 = array(); But now what I want is that depending on the group or member_level save the data in a table or in another table. I try this if( $_SESSION["GroupID"]=="1") { $data2 = array(); if( $_SESSION["GroupID"]=="2") { $data2 = array(); But I don't get it. I also try with $userdata $data2 = array(); if( $userdata["member_level"] = 1) { $data2 = array(); Any idea?. Thanks |
A
|
alfonso authorDevClub member 4/13/2022 |
I think I got it with: |