如何获取MySQL数据表字段名称
获取字段内容是如下代码:$query1 = "SELECT * FROM test"
_MySQL_Real_Query($MysqlConn, $query1)
$res = _MySQL_Store_Result($MysqlConn)
$fields = _MySQL_Num_Fields($res)
$rows = _MySQL_Num_Rows($res)
If $rows <> 0 Then
$array = _MySQL_Fetch_Result_StringArray($res)
;$array...................................
EndIf
$fields会得到test数据表字段数量,但想要获取 test 表的字段名称该怎么实现? 既然连接上了MYSQL,直接运行sql获取当前表的字段就行了吧 怎么连上的? select COLUMN_NAME from information_schema.COLUMNS where table_name = 'your_table_name' and table_schema = 'your_db_name'; 谢谢大家关注,已用其他方式解决~
页:
[1]