integer sybase_pconnect(string server, string username, string
password)
The sybase_pconnect function is identical to sybase_connect, except that connections
created with this function persist after the script ends. The connection lasts as long as the
server process does, so if the process executes another PHP script, the connection will be
reused. Connections created with sybase_pconnect should not be closed with
sybase_close.
integer sybase_query(string query, integer connection)
The sybase_query function executes a query on the given connection and returns a
result identifier. This is used by many of the other functions in this section. If the
connection argument is left out, the last opened connection is used.
string sybase_result(integer result, integer row, string field)
The sybase_result function returns the value of a particular field, identified by row and
field. The field argument may be an integer or the name of a field. Fields and rows are
numbered starting with zero. If performance is an issue, considering using
sybase_fetch_row, which is much faster.
<?
//connect using defaults
$Link = sybase_connect();
//use the store database
sybase_select_db("store", $Link);
//get all items
$Result = sybase_query("SELECT * FROM item ");
print("<TABLE BORDER=\"1\">\n");
//header row
$Fields = sybase_num_fields($Result);
for($i = 0; $i < $Fields; $i++)
{
$Field = sybase_fetch_field($Result);
print("
print("
print($Field->column_source);
print(".");
print($Field->name);
print("(");
print($Field->max_length);
print(")");
print("
print("