How to insert data in two different tables of two different database in php

前端 未结 5 838
醉酒成梦
醉酒成梦 2021-01-21 09:35

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

5条回答
  •  一生所求
    2021-01-21 09:52

    Well, that's how i do it...

    1 - connect --> that you are doing right 2 - check for errors 3 - USE a database (1) you want to put data in (and not 'SELECT') 4 - check for errors 5 - now INSERT items into the database THAT IS BEING USED - that is (1) 6 - check for errors 7 - USE the other database (2) 8 - check for errors 9 - INSERT the data into (2) - because that is the one in use now 10 - check for errors

    Yes, be paranoid :P Hope this helps

提交回复
热议问题