php mssql multiple connection, by mistake connect1 records updating in connection 2 even connection2 closed properly
<p>Application is PHP + MSSQL. 
Wrongly update in multiple connections. 
I have two connection. </p>

<ol>
<li>opening connection1.</li>
<li>doing some process.</li>
<li>opening connection2. (Note: to open connection2 we need connection1 database.)</li>
<li>doing some updates in connection 2.</li>
<li>closing connection2.</li>
<li>update and insert process in connection1. but system wrongly updating into connection2 database instead of connection1.</li>
</ol>

<p>How should handle the multiple connections.</p>
