user1083096
user1083096

Reputation: 187

SQL Query to list the contents of all the tables from the database

I wrote a PHP script to list all the tables present in the database using a query

$query = "SHOW TABLES FROM $dbName";

Now, i wanted to know what sql query can be use to list the "contents" of all the tables from the database simultaneously to display it and then store it in a file.

Thanks ahead of time..

Upvotes: 0

Views: 3090

Answers (2)

Naveen Kumar
Naveen Kumar

Reputation: 4591

IF what you want is to backup your database and restore it check out this link

MYSQL backup and restore

and you can use this command to create a backup of your databse

MYSQLDUMP

Upvotes: 0

Neo
Neo

Reputation: 7081

You can use mysqldump to dump all the data in the database. Else you can run for look on all the table names and then use select * from x; to get all the data from the table name x which you retrieved earlier.

Upvotes: 2

Related Questions