I was searching for a way to insert data into two database tables in a single query in such a way that if one failed, neither saved (I don\'t want orphaned data). I came ac
you need to use multi_query instead.
multi_query
http://php.net/manual/en/mysqli.multi-query.php