I have two tables user and email. One user can have multiple emails so its a seperate table(that contains user_id as part of its primary key).
I would like to insert multiple attributes into user table and one email into email table as well.
What is the best way to do that with mySQL query.
Is there any single line command that will do that??
If i cant do that with just with mySql I can use php script as well
Update
I see that people are misunderstanding my question.
All i want to do is to insert values like username password into my user table and one email into the linked email table (the one linked to the same user)
I wonder what is the best way to do it in mySQL (and if necessarly Php)
I would like the answer to include the mySQL query (and php scrips as well if necessarily)
The best way is to do it in a transaction. That way, if the e-mail insert fails the entire transaction will also fail.