I just created a user profile page that contains a form populated by form generator. In this case, I want to create a new record to profile_table that includes a foreign key of the user_table. Now in order to connect the user id with a user profile, I created a server action with a database insert where I set the value of (userid) foreign key to match the user_id.
Just want to make sure this is the right approach? At least it show as supposed in my database table!
The only way to do that is to create a View in your third party database program. I use Navicat for example. Not sure if you can create views in PHPMyAdmin or not.
Your server action should work correctly. The user’s relation with the entry in the user profile table will be correct. The only nuance. If the security provider uses the same user table as the “query_user_id” query, you can do without this query at all. And take the user id directly from the security provider. After all, the user is already logged in.