I am working with MySQL transactions and have a question.
Say I have started a transaction on a database A using:
$mysqli->begin_transaction(MYSQLI_TRANS_START_READ_ONLY);
where $mysqli is handle to my database A and I do some queries.
Now without reconnecting and commiting, I select another DB Database B using:
$mysqli->select_db("B");
Now, will the transactions which I started on database A still be effective even after switching the DB?
I want the transactions to commit only after I give $mysql->commit()
and not when switching DBs.
And if there are any errors, will it rollback in DB A as well as DB B if the transactions were started with handle as DB A?
Thanks in advance