如何打印mysql表的字段

时间:2015-12-17 13:01:34

标签: php mysql

$fld_one ='SHOW COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE SCHEMA = '.$dbone'.'AND TABLE NAME = '.$tbone.'';

SHOW COLUMNS FROM $tbone FROM mydb;

2 个答案:

答案 0 :(得分:1)

它的查询给出了所有column_name

contruction of baseC
contruction of childC
destruction of childC
destruction of baseC

答案 1 :(得分:0)

这应该有希望做你想做的事。

$sql="select `column_name` 
from `information_schema`.`columns` 
where `table_schema`=database() and `table_name`='$tbone';";