B
B
BoriHagen2021-04-05 12:10:13
SQL
BoriHagen, 2021-04-05 12:10:13

Why does SHOW TABLES FROM show only one table?

$sdd_db_host='localhost';
$sdd_db_name="db";
$sdd_db_user='root';
$sdd_db_pass='pass';

$dbh = mysql_connect($sdd_db_host, $sdd_db_user, $sdd_db_pass) or die("Не могу соединиться с MySQL.");
mysql_select_db($sdd_db_name) or die("Не могу подключиться к базе.");
mysql_query('SET NAMES utf8');

while($prodTable = mysql_fetch_array(mysql_query("SHOW TABLES FROM `db`"))){
    print_r($prodTable);
}


Displays only one table from the database, although there are five of them

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Hog, 2021-04-05
@BoriHagen

// ...

$result = mysql_query("SHOW TABLES FROM `db`");

while($prodTable = mysql_fetch_array($result)) {
    print_r($prodTable);
}

M
mletov, 2021-04-05
@mletov

Try SHOW FULL TABLES
Maybe there are temporary huts or views.
And the variant with php
https://stackoverflow.com/questions/15457429/how-d...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question