php获取mysql数据库中的所有表名的代码

yipeiwu_com6年前Mysql基础
复制代码 代码如下:

$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);

注意php中列表mysql中所有表名的函数mysql_list_tables,已经删除了,建议不要使用该函数列表mysql数据表

相关文章

用mysql内存表来代替php session的类

复制代码 代码如下:<?php /** @Usage: use some other storage method(mysql or memcache) instead of ph...

php mysqli查询语句返回值类型实例分析

本文实例分析了php mysqli查询语句返回值类型。分享给大家供大家参考,具体如下: <?php $link = new mysqli('localhost', 'r...

解析php session_set_save_handler 函数的用法(mysql)

复制代码 代码如下:<?php /*============================文件说明========================================...

mysql 全文搜索 技巧

<< Back to man.ChinaUnix.net  MySQL Reference Manual ...

整理的一些实用WordPress后台MySQL操作命令

不过假设你的WordPress网站上有成百上千篇文章,而你需要进行全站范围的改动, 这时从后台逐条编辑就有点费时费力了,并且犯错的几率也会提高。 最好的方法是进入WordPress的My...