0
现在我使用:如何获得sqlite 3中给定表的所有列名的列表? (表可能是空的)
PRAGMA table_info(table_name)
结构,但它不允许我以缩小搜索结果的列名,因为它原来很多不需要的数据。这是数组的数组
Array
(
[0] => Array
(
[cid] => 0
[name] => id
[type] => INTEGER
[notnull] => 0
[dflt_value] =>
[pk] => 1
)
[1] => Array
(
[cid] => 1
[name] => name
[type] => TEXT
[notnull] => 0
[dflt_value] =>
[pk] => 0
)
[2] => Array
(
[cid] => 2
[name] => timestamp
[type] => INTEGER
[notnull] => 0
[dflt_value] =>
[pk] => 0
)
[3] => Array
(
[cid] => 3
[name] => note
[type] => TEXT
[notnull] => 0
[dflt_value] =>
[pk] => 0
)
)
这将是结果不如做个
Array
(
[0] => id
[1] => title
[2] => timestamp
[3] => note
)
但选择PRAGMA table_info name
(表名)不工作