I have to insert data in two different database\'s table. I have created database1 and table1 for database1, also i have created database2 and table2 for database2.
For
Simply connect to 1 database, insert new row, disconnect, connect to the other database, insert row into that one and disconnect.
Or you can use $connect1
and $connect2
to refer to each of them separately and do the insertion parallely.
EDIT: Btw you can select the database with the 4'th parameter of mysql_connect
, no need to use mysql_select_db
And very important, you should write mysqli
not mysql
. Because mysql
functions are not going to be supported for much longer.