PHP uses mysql_fetch_row to query and obtain the data row list

Source: Internet
Author: User
This article describes how to use mysql_fetch_row to query and obtain the data row list in PHP, and describes how to use mysql_fetch_row to operate databases in php, for more information about how to use mysql_fetch_row to query data rows in PHP, see the following example. Share it with you for your reference. The specific analysis is as follows:

Here, mysql_fetch_row is used to query data from the mysql database and save it to the list.

Syntax:

Array mysql_fetch_row (resource $ Result_Set)

If the execution is successful, the list is returned. if the execution fails, false is returned. below is the demo code.

<? Php $ UserName = 'abc'; $ Password = '000000'; $ DbHandle = mysql_connect ('localhost', $ UserName, $ Password); if (! $ DbHandle) {die 'no database connection cocould be established. ';} $ DBName = 'wdb; if (! Mysql_select_db ($ DBName, $ DbHandle) {die 'database could not be selected. ';} $ Query = "select isbn, Title, Author FROM articles"; $ articles = mysql_query ($ Query, $ DbHandle )); while ($ Row = mysql_fetch_row ($ articles) {echo "ISBN = $ Row ['isbn ']
\ N ";}?>

I hope this article will help you with php programming.

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.