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 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. 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
Archived
This topic is now archived and is closed to further replies.