The confusion about PHP accessing access has plagued the day without solving

Source: Internet
Author: User
The confusion about PHP accessing access has plagued the day without solving




$sql = "SELECT * from Zhxl_article";

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

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


So every time you can print out the $row, I want to return the result contains only one specified field:
This sentence $sql = "SELECT * from Zhxl_article"; Replace with $sql = "Select Article_title from Zhxl_article", so that nothing can be printed, get no data, my fields are correct, can only return (*), the rest is not

Share to:


------Solution--------------------
Post the Print_r ($row); The results
------Solution--------------------
Odbc_errormsg ();

Look at what the error message
------Solution--------------------
Open source stuff is best matched with open source stuff. This is a deep-seated problem.
------Solution--------------------
Recommended use of the ADODB class
------Solution--------------------
Create COM components that can be accessed using ASP
------Solution--------------------
Select Article_title from Zhxl_article

If you are sure that there is no problem with the field name and table name, try the alias:

Select A.article_title from Zhxl_article a

  • 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.