Mysql query in Database How to get all the tables from database with all values in tables using single query..
I tried using 

$sql = "SHOW TABLES FROM $dbname";
$result = mysql_query($sql);
$arrayCount = 0
while ($row = mysql_fetch_row($result)) {
$tableNames[$arrayCount] = $row[0];
$arrayCount++; //only do this to make sure it starts at index 0
}
foreach ($tableNames as &amp;$name {
$query = "INSERT INTO metadata (table_name) VALUES ('".$name."')";
mysql_query($query);
}


but it gives me only tables name
Use the information_schema.columns table

i.e. 

select table_name,column_name from information_schema.columns