Description The sybase_fetch_field function, which was added in PHP 3.0.7 and PHP 4.0, returns an object containing properties of the field referenced in the result set at the field_off
Trang 1Description
The sybase_fetch_field() function, which was added in PHP 3.0.7 and PHP 4.0, returns an object containing properties of the field referenced in the result set at
the field_offset or the next field if no offset is specified The properties of the
return object are name, column_source, max_length, and numeric (1 if TRUE)
sybase_fetch_object()
Syntax
int sybase_fetch_object (int result)
Description
The sybase_fetch_object() function, which is available in PHP 3.0 and higher, returns an object that contains data from the fetched row with the data accessible using the field names
sybase_fetch_row()
Syntax
array sybase_fetch_row (int result)
Description
The sybase_fetch_row() function, which is available in PHP 3.0 and higher, returns
a zero-based array containing one row of data from the result set
sybase_field_seek()
Syntax
int Sybase_field_seek (int result ,int field_offset)
Description
Trang 2The sybase_field_seek() function, which is available in PHP 3.0 and higher, seeks
to the specified field_offset in the result set
sybase_free_result()
Syntax
int sybase_free_result (int result)
Description
The sybase_free_result() function, which is available in PHP 3.0 and higher, frees all resources associated with the result set
sybase_num_fields()
Syntax
int sybase_num_fields (int result)
Description
The sybase_num_fields() function, which is available in PHP 3.0 and higher, returns the number of fields in the result set
sybase_num_rows()
Syntax
Sybase_num_rows (string result)
Description
The sybase_num_rows() function, which is available in PHP 3.0 and higher, returns the number of rows in a result set and is typically used with a select statement
sybase_pconnect()
Syntax
Trang 3int sybase_pconnect (string servername, string username, string
password)
Description
The sybase_pconnect() function, which is available in PHP 3.0 and higher, is similar
to sybase_connect() except that the connection isn't terminated at the end of a script's processing
sybase_query()
Syntax
int sybase_query (string query, int link_identifier)
Description
The sybase_query() function, which is available in PHP 3.0 and higher, sends the
query to the database using the link_identifier connection If no link exists, the function will try to establish a connection as though sybase_connect() were called
sybase_result()
Syntax
int sybase_result (int result, int row, mixed field)
Description
The sybase_result() function, which is available with PHP 3.0 and higher, returns the contents of the cell located at the field and row in the result set The field
parameter can be the name (use alias column name if aliased), offset, or table name
dot field name (tablename.fieldname)
sybase_select_db()
Syntax
int sybase_select_db (sting database_name , int link_identifier)
Trang 4Description
The sybase_select_db() function, which is available in PHP 3.0 and higher, sets the current active database for the given link_identifier to the given database_name
If no connection is given, the last opened one will be used; if none exists, an attempt to establish one will be made
Trang 5Chapter 11 Chapter Utility Extensions
Within the PHP programming languages you will find many different utility extensions These extensions represent some of the more useful shrink-wrapped functions of the language itself They include the following:
• Calendar
• Compression
• Date and time
• Encryption
• GNU recode
• Image
• Regular expression
Calendar
This set of calendar functions represents items from both the MCAL (Modular Calendar Access Library) module and built-in functionality within PHP
MCAL
The MCAL set of functions operates in very much the same manner as the IMAP functions You open a stream to a particular calendar and then perform operations
on it To use these functions, you need to download the MCAL library from
http://www.mcal.chek.com, compile and install it, and compile PHP with the
with-mcal option
Note
The functions in this set were added in PHP 3.0.13 unless otherwise stated
The functions in the MCAL library use some predefined constants These are shown in
Table 11.1
Table 11.1 Constants Used in the MCAL Library
MCAL_SUNDAY
Day of Week
MCAL_MONDAY