查询数据库中所有表名
查詢數據庫中所有表名
select table_name from information_schema.tables where table_schema='csdb' and table_type='base table';
查詢指定數據庫中指定表的所有字段名column_name
select column_name from information_schema.columns where table_schema='csdb' and table_name='users'
?
php獲取:
$server = 'localhost';
$user = 'root';
$pass = '';
$dbname = 'dayanmei_com';
$conn = mysql_connect($server,$user,$pass);
if(!$conn) die("數據庫系統連接失敗!");
mysql_select_db($dbname) or die("數據庫連接失敗!");
$result = mysql_query("SHOW TABLES");
while($row = mysql_fetch_array($result))
{
echo $row[0]."";
}
mysql_free_result($result);
轉載于:https://www.cnblogs.com/q1104460935/p/6907241.html
總結
以上是生活随笔為你收集整理的查询数据库中所有表名的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10上编译libharu库
- 下一篇: linux cmake编译源码,linu