I am using transactions for the first time and I have a few questions.
1) Why am I getting a "Call to a member function autocommit() on a non-object" error
2) Am I properly storing results of the transaction in a $result variable as I try to do below so that I can run the below IF statement?
3) Can I add joins into the transaction queries like with any other query?
$mysqli = $wpdb; //call to wordpress database
$mysqli->autocommit(false);
$mysqli->$query("INSERT INTO stories (ID, category, genre, story_name, active) VALUES
('$user_ID', '$category', '$genre','$story_name', '1')");
$mysqli->$query("INSERT INTO writing (ID, text, position, approved)
VALUES('$user_ID', '$text', '1','N')");
$myqli->commit();
$result = $mysqli($query);
if($result)
{ echo("Your article is underway!");}
else { echo("Article failed");}