Query: msql_fetch_object
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MSQL_FETCH_OBJECT(3) MSQL_FETCH_OBJECT(3) msql_fetch_object - Fetch row as objectSYNOPSISobject msql_fetch_object (resource $result)DESCRIPTIONmsql_fetch_object(3) is similar to msql_fetch_array(3), with one difference - an object is returned, instead of an array. Indirectly, that means that you can only access the data by the field names, and not by their offsets (numbers are illegal property names). Speed-wise, the function is identical to msql_fetch_array(3), and almost as quick as msql_fetch_row(3) (the difference is insignificant).PARAMETERSo $ result -The result resource that is being evaluated. This result comes from a call to msql_query(3).RETURN VALUESReturns an object with properties that correspond to the fetched row, or FALSE if there are no more rows.EXAMPLESExample #1 msql_fetch_object(3) example <?php $con = msql_connect(); if (!$con) { die('Server connection problem: ' . msql_error()); } if (!msql_select_db('test', $con)) { die('Database connection problem: ' . msql_error()); } $result = msql_query('SELECT id, name FROM people', $con); if (!$result) { die('Query execution problem: ' . msql_error()); } while ($row = msql_fetch_object($result, MSQL_ASSOC)) { echo $row->id . ': ' . $row->name . " "; } msql_free_result($result); ?>CHANGELOG+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.0.4 | | | | | | | A bug was fixed when retrieving data from col- | | | umns containing NULL values. Such columns were | | | not placed into the resulting array. | | | | +--------+---------------------------------------------------+SEE ALSOmsql_fetch_array(3), msql_fetch_row(3), msql_data_seek(3), msql_result(3). PHP Documentation Group MSQL_FETCH_OBJECT(3)
Related Man Pages |
---|
sqlsrv_fetch(3) - php |
ingres_fetch_array(3) - php |
msql_fetch_object(3) - php |
mysql_data_seek(3) - php |
mysql_free_result(3) - php |
Similar Topics in the Unix Linux Community |
---|
reversing a line |
problem in access in array variables |
Compare arrays (perl) |
File modification problem |
calculating row-wise standard deviation using awk |