$sql = "INSERT INTO img_upload (`id`, `img_name`, `img_path`, `img_type`)
VALUES ('$id', '$filename','$filepath','$filetype') ;
INSERT INTO ads (`img_id`, `groupList`, `adType`, `dateField`, `adCost`)
VALUES (LAST_INSERT_ID(), '4', '$adType', CURDATE(), '$adCosts');
INSERT INTO admin (`id`, `ad_id`, `adType`)
VALUES ('$id',LAST_INSERT_ID(), '$adType');
";
Although this insert works, I'm curious if there is a more elegant way of inserting into multiple tables at once, id been the main unique identifier of the database