PHP uses Mysql_fetch_object to get the set of objects from the query results, Mysqlfetchobject
This example describes how PHP uses Mysql_fetch_object to get the set of objects from the query results. Share to everyone for your reference. The specific analysis is as follows:
The Mysql_fetch_object function is used to extract the result line from a MySQL result set as an objectiative array.
Mysql_fetch_object Syntax:
Array mysql_fetch_object (Resource $Result _set)
The Result_set handle returns a mysql_query query result set.
If execution successfully returns an object containing all data rows, returns a bool value if it fails
Here is the demo code:
<?php$username = ' abc '; $Password = ' 1234 '; $DbHandle = mysql_connect (' localhost ', $UserName, $Password); if (!$ Dbhandle) {die ' No database connection could is established. ';} $DBName = ' W3db;if (!mysql_select_db ($DBName, $DbHandle)) {die ' Database could not being selected. ';} $Query = "Select ISBN, Title, Author from articles"; $articles = mysql_query ($Query, $DbHandle)) and while ($Row = Mysql_fetch _object ($articles)) {echo "ISBN = $Row->ISBN
\ n "; echo "Title = $Row->title
\ n "; echo "Author = $Row->author
\ n ";}?" >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/969478.html www.bkjia.com true http://www.bkjia.com/PHPjc/969478.html techarticle PHP uses Mysql_fetch_object to get the set of objects from the query results, Mysqlfetchobject This example describes how PHP uses Mysql_fetch_object to get the set of objects from the query results. ...