mysql表名规则怎么算 mysql表名可以用数字吗

PHP+MYSQL 怎样按条件查询数据库里表的名称?

mysql 有一个默认的数据库,叫做information_schema

专注于为中小企业提供做网站、网站建设服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业海曙免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了近千家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

连上这个库,执行下面的语句(你自己那可能的改下下面的sql)

//table_schema 是你的数据库名字 table_name是表名

select * from tables where table_schema = 'storage' and table_name like 'product%'

你看看库中这个表结构就明白了,呵呵

PHP+MYSQL 怎样按条件查询数据库里表的名称?

mysql

有一个默认的数据库,叫做information_schema

连上这个库,执行下面的

语句

(你自己那可能的改下下面的sql)

//table_schema

是你的数据库名字

table_name是表名

select

*

from

tables

where

table_schema

=

'storage'

and

table_name

like

'product%'

你看看库中这个表

结构

就明白了,呵呵

mysql数据表名查询

$sql="show tables";

$r=mysql_query($sql);

$data=mysql_fetch_array($r);

这样就可以获得数据库中的表信息了

如何按条件查询MYSQL数据库中的表名

//PHP实现

?php

$connect = mysql_connect("localhost","root","123456");

$result = mysql_query("SHOW TABLES",$connect);

$tables = array();

while($table = mysql_fetch_row($result)) {

$table = array_pop($table);

if(is_numeric($table)) $tables[$table] = $table;

}

krsort($tables);

var_dump(array_shift($tables));

//End_php


新闻名称:mysql表名规则怎么算 mysql表名可以用数字吗
文章地址:http://scyanting.com/article/dochojd.html