Search code examples
phpmysqldatabaseshowselectall

How to select an entire database and display all the information


Is it possible to select all the tables from a database (not knowing their names) and displaying them? My friend has a mysql server but he doesn't have phpMyAdmin installed and he's begging me to transfer all his php-fusion accounts to his new WordPress blog. He doesn't understand a thing with mysql... Anyone got an idea?


Solution

  • Use the SHOW and DESCRIBE statements. That's all phpMyAdmin is doing in the code. Your SQL user should have privileges.

    List all tables:

    SHOW tables;
    

    List table definition:

    DESCRIBE table_name;
    

    Check out MySQL for more details.