How to move a table from one Database to another Database without using phpMyAdmin? It will be better if it is possible by PHP.
Entire Database (all tables):
mysqldump -u root databasename > dump.sql mysql -u root databasename < dump.sql
One Table:
mysqldump -u root -p yourpass dbname tablename | mysql -u root -p pass secondDB
PHP:
Run PHP SELECT FROM SOURCE-DB TABLE and Run INSERT INTO Table IN TARGET-DB
ALTER TABLE .. can be used to move tables from one database to another:
ALTER TABLE ..
alter table my_old_db.mytable rename my_new_db.mytable
Warning: as you asked, this is a move, not a copy to the new database!
But you will keep table data (and not integrity constraints if they apply in your case)
Regarding php, php is able to run sql commands so it won't be a problem.