deepshah2004 Posted January 22, 2009 Share Posted January 22, 2009 I would like to know what mysql statements to use when inserting data to two tables simultaneously in different fields for inserting data to only one table i am using the following syntax: // insert the record to the table $insert="insert into sales (sales_id,date,item_code,description,customer_name,customer_ac_no,quantity,unit_price,amount,discount,net_amount,terms)values('$s','$d','$i','$de','$cn','$ca','$q','$u','$a','$di','$na','$t')"; if (mysql_query($insert)) { echo ("sale entered successfully "); } else { echo ("failed to enter the sale").mysql_error(); } thanks please help urgently Quote Link to comment https://forums.phpfreaks.com/topic/141901-inserting-data-to-two-tables-simultaneously-in-different-fields/ Share on other sites More sharing options...
fenway Posted January 27, 2009 Share Posted January 27, 2009 You can't... one insert req'd per table. Quote Link to comment https://forums.phpfreaks.com/topic/141901-inserting-data-to-two-tables-simultaneously-in-different-fields/#findComment-747508 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.