I have 2 different databases: db_1 , db_2
I need to switch between the 2 databases multiple times in the same script.
for example:
$result=mysql_query("insert into table set field='$field'");
$result_id = mysql_insert_id();
then i need to insert the result id into db_2
i could connect to the first db, then close it, then reconnect to the second db, then close it, then reconnect to the first db, but there must be a better way.
please help.