1
Good morning! Staff need a Help I am facing the following problem
I have two tables in the database (Clinics) and (users)
I want to insert the data into the two tables in a sensitive way, so
that is done sending the form, the form data i already
I’m pulling from the form all the data are already being picked up.the problem and that I need to enter the fields of the same form in
individual tableson the table (Clinics) I just have a field called clinic_name where,
this shall be the first field to be filled in at the time of dispatch
form because in this table (Clinics) an id will be generated
I have to pick to fill the table (users) in sequencewhere to fill the table (users) consequently I will have what to do a search in the table (Clinics) and get the clinic id and
fill in the field user_clincis_id in the table (users)The two tables are (Clinics) and (users) key relationship
among them where foreign (Clinics 1) (users n) one for
many associativeWell I’ve done a lot of things I’ve even thought about doing a routine random
more I want an opinion of vcs which would be the best way to follow the images below, the image routine below so far only fill the table users
Gustavo I’ll try this routine here I’ll adjust it to my routine here and see if it goes well, finish here I come back to tell you if it worked, Thanks
– gomes
To be able to solve this way I created the method to get the last id in the parent class and in the daughter class I called the method to get id under the name of the clinic I called the method to get the last id inserted and then I continued inserting the data already with id of the clinic worked beauty, I used the lastInsertId() method that you mentioned worth
– gomes
Okay, thanks for the feedback, I’m also a bit of a beginner in php but my poblema was similar to yours. Hug.
– Gustavo Tinoco