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