How can I obtain the Access field name in php? today, I have obtained the Access database data, but how can I obtain the table field name? & nbsp; I have obtained all the fields in the table without displaying numbers & nbsp; // ================== how to obtain the Access field name in php
Today, I have obtained the data used in the Access Database. but how can I obtain the table field name?
All the obtained fields are numerical fields that do not display table names.
// ================================================ ======================================
// Get record list
// Obtain the record list
// ================================================ ======================================
Public function getlist ($ table, $ field, $ fieldnum, $ condition = "", $ sort = "") // retrieves the record list
{
$ SQL = "SELECT". $ field. "FROM". $ table. "". $ condition. "". $ sort;
$ Query = $ this-> query ($ SQL );
$ I = 0;
While ($ this-> fetch_row ($ query ))
{
For ($ j = 0; $ j <$ fieldnum; $ j ++)
{
$ Info [$ j] = odbc_result ($ query, $ j + 1 );
}
$ Rdlist [$ I] = $ info;
$ I ++;
}
Return $ rdlist;
}
This is my method.
------ Solution --------------------
I have never used odbc. check whether there are any methods like mysql_fetch_array () mysql_fetch_assoc (). you can directly use the field name in the table.
------ Solution --------------------
Odbc_field_name
------ Solution --------------------
The mysql_list_fields () function returns the field name of the table.
------ Solution --------------------
Odbc_fetch_into
------ Solution --------------------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.