I want to make two prepared statements, one right after the other in PHP with MySQLi. I am a novice at PHP and MySQLi so I don’t know whether I should close the statement, close the database connection, put all of the code in a function, or just have code not inside a function.
Basically, I just want to insert a record into one table and then insert the same record into another table using MySQLi.
Directly off the mysqli page: http://php.net/manual/en/mysqli.commit.php
*Edit with prepared statements for “non-sane” action: