Select and insert into php/mysql


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, 


Wouldn’t this be better suited on a MySQL/PHP forum?

Anyway, as far as I know you can’t mix INSERT INTO SELECT FROM with VALUES. I could be wrong, and/or I could have just been using a SQL implementation that didn’t support things like that.


of course ! thank you