说明
getTableInfo可以获取表信息,信息类型 包括 fields,type,bind,pk,以数组的形式展示,可以指定某个信息进
行获取
示例
// 获取`think_user`表所有信息
Db::getTableInfo('demo');
// 获取`think_user`表所有字段
Db::getTableInfo('demo', 'fields');
// 获取`think_user`表所有字段的类型
Db::getTableInfo('demo', 'type');
// 获取`think_user`表的主键
Db::getTableInfo('demo', 'pk');
输出
Array (
[fields] => Array ( [0] => id [1] => name [2] => score )
[type] => Array ( [id] => int(11) unsigned [name] => varchar(20) [score] => int(10) )
[bind] => Array ( [id] => 1 [name] => 2 [score] => 1 )
[pk] => id
)
Array ( [0] => id [1] => name [2] => score )
Array ( [id] => int(11) unsigned [name] => varchar(20) [score] => int(10) )
id
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。