hello i have 2 tables account_info and patient_info i want the user to fill first the account_info table and then the patient_info
but i have to select account_id and patient_username from account_info and insert them in patient_info then the user enters patient name and the rest of the information
i have :
$sql = "INSERT INTO patient_info(p_username, acc_id, p_fname, p_lname, p_gender, p_condition,
p_birthdate, p_emergencycontact)
SELECT p_username, acc_id
FROM account_info
VALUES(:p_fname, :p_lname, :p_gender, :p_condition, :p_birthdate,
:p_emergencycontact)";