Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

contains the properties described in Table 13.12. See sybase_result for an example of
use.


object sybase_fetch_object(integer result)


The sybase_fetch_object function returns an object with a property for each of the
fields in the next row. Each call to sybase_fetch_object gets the next row in the result
set, or returns FALSE if no rows remain. Compare this function to sybase_fetch_array
and sybase_fetch_row.


Table 13.12. sybase_fetch_field Object Properties
Property Description

column_source (^) The name of the table the column belongs to.
max_length (^) The maximum size of the field.
name (^) Name of the column.
numeric (^) If the column is numeric, this property will be true (1).
<?
//connect
$Link = sybase_pconnect();
//use the store database
sybase_select_db("store", $Link);
//get all items
$Result = sybase_query("SELECT * FROM item ");
print("<TABLE BORDER=\"1\">\n");
//get rows
while($Row = sybase_fetch_object($Result))
{
print("\n");
print("$Row->Name\n");
print("$Row->Price\n");
print("\n");
}
print("\n");
?>
array sybase_fetch_row(integer result)
The sybase_fetch_row function returns an array of all the field values for the next row.
The fields are indexed by integers starting with zero. Each call to sybase_fetch_row

Free download pdf