woody` Posted November 9, 2006 Share Posted November 9, 2006 Hello all, How can you achieve in inserting a record to a multiple table in a single query. $query_mboard= "INSERT INTO mboard VALUES ('','$mboard_desc','$mboard_serial')"; $query_pcset = "INSERT INTO pcset VALUES('','$pcname')"; $query_cpu = "INSERT INTO cpu VALUES('','$cpu_desc','$cpu_serial')"; <--------------- Im going to insert some records into 3 tables. $result = mysql_query($query_cpu); <---- Id also like to query it if it went through coz im using a unique id in some of the rows if($result==1) { echo "<img src=links/ok.png>Added to database"; } else { echo "<img src=links/failed.png>Failed adding to Database"; } Regards, - woody Link to comment https://forums.phpfreaks.com/topic/26739-multiple-table-single-query/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.