php - How to insert different values into two tables with single submit and inner join in MySQL -
is possible insert values 2 tables using inner join..? tables user,details
user table contains user_id,name,passwrd
details table contain id,address,email
what did:
if(isset($_post['submit'])=='submit') { $user_name = $_post['user_name']; $user_password = $_post['user_password']; $details_email = $_post['details_email']; $details_phn = $_post['details_phn']; $details_age = $_post['details_age']; $sql_query="insert tbl_user(user_name,user_password)values('$user_name','$user_password')"; $result=mysql_query($sql_query); $sql_query1="insert tbl_details(details_email,details_phn,details_age)values('$details_email','$details_phn','$details_age')"; $result1=mysql_query($sql_query1); }
how can rewrite innerjoin...pls me..
http://dev.mysql.com/doc/refman/5.0/en/join.html
mysql supports following join syntaxes table_references part of select statements , multiple-table delete , update statements:
you can't use join
insert
. sorry.
may ask , what's problem 2 queries?
update check @volkerk 's comment, offers alternative possible solutions: sql - insert multiple tables in 1 query
Comments
Post a Comment