Query: mssql_fetch_object
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MSSQL_FETCH_OBJECT(3) MSSQL_FETCH_OBJECT(3) mssql_fetch_object - Fetch row as objectSYNOPSISobject mssql_fetch_object (resource $result)DESCRIPTIONmssql_fetch_object(3) is similar to mssql_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 mssql_fetch_array(3), and almost as quick as mssql_fetch_row(3) (the difference is insignifi- cant).PARAMETERSo $result - The result resource that is being evaluated. This result comes from a call to mssql_query(3).RETURN VALUESReturns an object with properties that correspond to the fetched row, or FALSE if there are no more rows.EXAMPLESExample #1 mssql_fetch_object(3) example <?php // Send a select query to MSSQL $query = mssql_query('SELECT [username], [name] FROM [php].[dbo].[userlist]'); // Check if there were any records if (!mssql_num_rows($query)) { echo 'No records found'; } else { // Print a nice list of users in the format of: // * name (username) echo '<ul>'; while ($row = mssql_fetch_object($query)) { echo '<li>' . $row->name . ' (' . $row->username . ')</li>'; } echo '</ul>'; } // Free the query result mssql_free_result($query); ?>NOTESNote Field names returned by this function are case-sensitive. Note This function sets NULL fields to the PHP NULL value.SEE ALSOmssql_fetch_array(3), mssql_fetch_row(3). PHP Documentation Group MSSQL_FETCH_OBJECT(3)
Related Man Pages |
---|
mysqli_result.fetch_assoc(3) - php |
msql_fetch_object(3) - php |
mssql_num_fields(3) - php |
mysqli_fetch_assoc(3) - php |
sqlite_fetch_array(3) - php |
Similar Topics in the Unix Linux Community |
---|
duplicating 1st row of data |
query file name |
Writing records from resultset to file |
Simple scripting. |
Check up the status of a Script (running or not) |