Hi,
I'm trying to copy the data from a table in one database to another table (with the same fields of the origin table) in another database. And this is my code

$con= mysqli_connect("localhost", "root", "") or die("error");
        $sql="insert motcenter.d select * from mot_hrms.d ";
        $result=$con->query($sql);

But nothing happens when I run the code, or just few records copied with other tables.

I appriciate any help, and sorry for my poor english.

Recommended Answers

Be aware I don't know what the LIMIT is set to today either default or your install. MySQL used to limit the return results.
Read https://superuser.com/questions/240291/how-to-remove-1000-row-limit-in-mysql-workbench-queries for a prior kick around on this …

Jump to Post

Why not download the table and upload it to other ?

Jump to Post

All 5 Replies

Why not download the table and upload it to other ?

INSERT INTO <DESTINATION TABLE NAME> SELECT * FROM <SOURCE TABLE NAME>

BUT FIELDS NAME AND TYPE OF DESTINATION SHOULD BE SAME AS SOURCE.

Thanks all
I figured out the problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.