The confusion about accessing php has not been solved for a day.

Source: Internet
Author: User
Connstr = "DRIVER = Microsoft & nbsp; access & nbsp; Driver & nbsp ;(*. mdb); DBQ = ". realpath ("D:/zhxlweb/web/www.test.com/zhxl.mdb ")

$connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=".realpath("D:/zhxlweb/web/www.test.com/zhxl.mdb") ; 
    $connid=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC ); 

$sql = "select * from zhxl_article";

$query = odbc_exec($connid,$sql);

while($row=odbc_fetch_array($query)){
print_r($row);
}


In this way, $ row can be printed every time. I want to return only one specified field:
Replace $ SQL = "select * from zhxl_article"; with $ SQL = "select article_title from zhxl_article"; in this way, nothing can be printed and no data can be obtained, all my fields are correct. only (*) can be returned, and others cannot be shared:
------ Solution --------------------
Paste the result of print_r ($ row );
------ Solution --------------------
odbc_errormsg();

Check the error message.
------ Solution --------------------
Open-source things are best suited to open-source things. This is a deep-seated problem.
------ Solution --------------------
We recommend that you use the ADODB class.
------ Solution --------------------
Create a COM component and use ASP to access it.
------ Solution --------------------
Select article_title from zhxl_article

If the field name and table name are correct, use an alias:

Select a. article_title from zhxl_article

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.