SHOW CREATE TABLE导出数据表结构

$sql = "show create table category";
$res = mysql_query($sql) or die(mysql_error());
while($obj=mysql_fetch_object($res))
...{
print_r($obj);
echo "<hr>";
}
输出
stdClass Object
(
[Table] => category
[Create Table] => CREATE TABLE `category` (
`CategoryID` int(10) unsigned NOT NULL default '0',
`CategoryName` varchar(80) NOT NULL default '',
`ParentID` int(10) unsigned NOT NULL default '0',
`Keywords` varchar(255) NOT NULL default '',
`ProductCount` mediumint(6) unsigned NOT NULL default '0',
`TradeLeadCount` mediumint(6) NOT NULL default '0',
`CompanyCount` mediumint(6) NOT NULL default '0',
`B2soutletcount` mediumint(6) unsigned NOT NULL default '0',
`CategoryType` tinyint(1) NOT NULL default '0',
`Section` tinyint(1) unsigned NOT NULL default '0',
`IsLeaf` tinyint(1) NOT NULL default '1',
`Link` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`CategoryID`),
KEY `GroupName` (`CategoryName`),
KEY `ParentID` (`ParentID`),
KEY `CategoryType` (`CategoryType`),
KEY `Section` (`Section`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
)

上一篇: 控制Checkbox全选的JS   下一篇: 常用的PHP兼容性代码

提交疑问

回顶部