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.