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
(表名)不工作