Ask PHP how to get the field name of access
Doing something today to get the data in the Access database I've got it, but how do I get the field name of the table?
All I get is numbers. Field names that do not display the table
//=================================================================
Get record list
Get a list of records
//=================================================================
Public Function GetList ($table, $field, $fieldnum, $condition = "", $sort = "")//Get a list of records
{
$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 way of writing.
------Solution--------------------
You don't have to use ODBC. Mysql_fetch_array () Mysql_fetch_assoc () This type of method can be used directly in the table field names
------Solution--------------------
Odbc_field_name
------Solution--------------------
The Mysql_list_fields () function can return 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service