PHP uses mysql_fetch_object to obtain the object set from the query result, mysqlfetchobject. PHP uses mysql_fetch_object to obtain the object set from the query results. mysqlfetchobject this article describes how PHP uses mysql_fetch_object to obtain the object set from the query results. PHP uses mysql_fetch_object to obtain the object set from the query results. mysqlfetchobject
This example describes how PHP uses mysql_fetch_object to obtain an object set from the query results. Share it with you for your reference. The specific analysis is as follows:
The mysql_fetch_object function is used to extract the result row from a MySQL result set as an array of objectiative.
Mysql_fetch_object syntax:
array mysql_fetch_object (resource $Result_Set)
The Result_Set handle returns a mysql_query query result set.
If the execution is successful, return the object that contains all data rows. if the execution fails, return the bool value.
The following is the demo code:
<?php$UserName = 'abc';$Password = '1234';$DbHandle = mysql_connect ('localhost', $UserName, $Password);if (!$DbHandle) { die 'No database connection could be established.';}$DBName = 'w3db;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_object ($articles)) { echo "ISBN = $Row->ISBN
\n"; echo "Title = $Row->Title
\n"; echo "Author = $Row->Author
\n";}?>
I hope this article will help you with php programming.
Examples in this article describes how PHP uses mysql_fetch_object to obtain an object set from the query results ....