Public Member Functions | |
| __construct ($datasource) | |
| Constructor. | |
| objDbConnection () | |
| Connect to database server. | |
| objDbClose () | |
| Close connection to database server. | |
| objServerVersion () | |
| Return info on database server. | |
Definition at line 15 of file sybaseConnection.php.
| __construct | ( | $ | datasource | ) |
Constructor.
public
| array | $datasource |
Definition at line 47 of file sybaseConnection.php.
{
$this->objDatasource = $datasource;
$this->objDatasource[5] = ( array_key_exists( 5, $this->objDatasource ) && $this->objDatasource[5] ) ? true : false;
}
| objDbClose | ( | ) |
Close connection to database server.
public
Definition at line 84 of file sybaseConnection.php.
{
return sybase_close( $this->objConnection );
}
| objDbConnection | ( | ) |
Connect to database server.
public
Definition at line 59 of file sybaseConnection.php.
{
//set higher levels to counteract random connection errors
//php_sybase_ct.dll/server/PHP5 bug?
sybase_min_client_severity( 100 );
sybase_min_server_severity( 100 );
$this->objConnection = ( $this->objDatasource[5] ) ? sybase_pconnect( $this->objDatasource[1], $this->objDatasource[2], $this->objDatasource[3] )
: sybase_connect( $this->objDatasource[1], $this->objDatasource[2], $this->objDatasource[3] );
if ( $this->objConnection )
//this may or may not be ignored - database is coupled with schema/server/user/pass
sybase_select_db( $this->objDatasource[4], $this->objConnection );
else
trigger_error( sybase_get_last_message(), E_USER_WARNING );
return $this->objConnection;
}
| objServerVersion | ( | ) |
Return info on database server.
public
Definition at line 95 of file sybaseConnection.php.
{
$objStmt = sybase_query( 'SELECT @@VERSION' );
$objResult = sybase_fetch_row( $objStmt );
sybase_free_result( $objStmt );
return $objResult[0];
}
1.7.1