我想知道表的結構。我如何在CodeIgniter中做到這一點。使用數據庫級的我,當我跑$this->db->query('desc mytable');
如何獲取CodeIgniter中的表結構
6
A
回答
13
0
詳細描述信息,你應該使用
$fields = $this->db->field_data('table_name');
你'將會得到像這樣的foreach領域的東西stdClass
name = "id"
type = "int"
max_length = 11
default = null
primary_key = 1
相關問題
- 1. 獲取結構中的字段列表
- 2. 如何在CodeIgniter中獲得有用信息的URL結構?
- 3. 如何在java中獲取數據庫的表結構?
- 4. 如何獲取SQL Server中的表結構?
- 5. 如何在單行中獲取列名稱的表結構?
- 6. Codeigniter中的結構函數
- 7. 如何使用CodeIgniter中的單個查詢從多個表中獲取結果?
- 8. 獲取結構
- 9. Codeigniter結構
- 10. 如何從文件夾結構中獲取文件列表
- 11. 如何使用xslt從表結構中獲取值
- 12. 如何從codeigniter中的URL獲取ID?
- 13. 如何在PHP中獲取MySQL表結構?加上所有表的列表?
- 14. 查詢獲取表的結構
- 15. 獲取用於按層次結構表結構的DAO
- 16. 如何從Mysql和Codeigniter中的兩個表中獲取數據
- 17. 如何從codeigniter中的表中獲取用戶名
- 18. 如何從codeigniter中的數據庫表中獲取數據?
- 19. Spring:如何獲取bean層次結構?
- 20. 如何在CodeIgniter中執行JOIN操作並獲取結果?
- 21. 如何獲得jQuery中父樹子結構在ul列表中的結構?
- 22. 如何獲取CodeIgniter中的獲取請求的當前網址?
- 23. 如何在C中的聯合中獲取結構的大小?
- 24. 獲取codeigniter中表的總列字段?
- 25. 關於CodeIgniter結構
- 26. CodeIgniter項目結構
- 27. 如何在codeigniter中獲取輸入表單的json值
- 28. 如何獲得許多表結構?
- 29. 如何獲取表的架構名稱
- 30. 如何在codeigniter中獲取linkedin數據
'$ this-> db-> query('DESCRIBE mytable');'不起作用? – Ben
不起作用。似乎查詢功能只接受SELECT關鍵字 – Fazri