Ok, I have two websites, both are on the same server, and, I want to transfer all data in the table on one, to a table of the same name on the other.
I want to transfer data in the table of one of those websites to the other. What is the best way to do that?
I have tried INSERT INTO db2.$g SELECT * FROM db1.$g
I get that error, SELECT permission is denied.
Some quick facts....
** I have WHM and cPanel
** Separate webhostings for each of these two websites
** Both are on the same server
** I use PHP 4.4, although I can get PHP 8 if that would be better
Now, I have done the following....
** I have set up another file, {twin-view}, to show information from the table of the same name, in each of the two websites. Two HTML tables sit side by side on the resulting web page. This file works perfectly.
** I have used the same pair of mysql_connect statements in my transfer program as I did with the twin-viewer program.
** I have different user names for each of the two websites. Would it be possible/handy for me to somehow add a common user to both websites, and, if so, how would I do that?
** I have set up all of the tables in, the second website. I just want to copy the data in the tables across. The second website remains empty of data.
** The transfer and twin-view files are on the website 2, of which I aim to copy to. Would it work better if I had this on the source-site?
The only way of which I can see for it to work right now is, to do a mysql_query, then use a while loop to insert that data into database 2, just like I would be populating a HTML table for a web page.
I am happy to try