downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

sybase_data_seek> <sybase_close
[edit] Last updated: Fri, 24 Feb 2012

view this page in

sybase_connect

(PHP 4, PHP 5)

sybase_connectAbre uma conexão Sybase

Descrição

resource sybase_connect ([ string $servername [, string $username [, string $password [, string $charset [, string $appname ]]]]] )

Retorna: um identificador de recurso Sybase positivo em caso de sucesso ou um FALSE em caso de falha.

sybase_connect() estabelece uma conexão com um servidor Sybase. O argumento servername tem que ser um nome de servidor que é definido no arquivo 'interfaces'.

Se uma segunda chamada é feita ao sybase_connect() com os mesmos argumentos nenhum novo recurso será estabelecido. Ao invés disto, o identificador de recurso do recurso já aberto será retornado.

O recurso com o servidor será fechado tão logo a execução do script termine, a não ser que ele seja fechado anteriormente ao se chamar explicitamente o sybase_close().

Exemplo #1 Exemplo sybase_connect()

<?php
    $link 
sybase_connect('SYBASE''''')
            or die(
"Could not connect !");
    print (
"Connected successfully");
    
sybase_close($link);
?>

Veja também sybase_pconnect() e sybase_close().



sybase_data_seek> <sybase_close
[edit] Last updated: Fri, 24 Feb 2012
 
add a note add a note User Contributed Notes sybase_connect
brunello95 at aol dot com 15-Mar-2005 03:30
freetds is a great, free tool to access your sybase tables with PHP. The setup can be a bit tricky. Use the following to put the environment variables that you need:
<?php
putenv
("SYBASE=/usr/local/freetds");
putenv ("SYBPLATFORM=linux");
putenv ("LD_LIBRARY_PATH=/usr/local/freetds/lib");
putenv ("LC_ALL=default");
putenv ('PATH=\"/usr/local/freetds/bin:$PATH\"');
putenv ("DSQUERY=SYBASE");
?>
Even if not using freetds, you'll need those env vars to make any sybase connection work. Another option is to just load them into your box from the command line.
naguiwerian at netscape dot net 18-Sep-2001 03:31
To connect from win32 to Sybase on Unix , you can use sybase open client and make sure to use the hostname in sybase_connect as it is defined in the OC sql.ini file .. it worked that way !
bkw at weisshuhn dot de 05-Apr-2000 11:38
To decrease the level of messages sent back from the dbserver (such as 'changed context...') try:

     sybase_min_server_severity(11);
gregory at bnl dot gov 04-Feb-2000 12:35
If you are having trouble connecting to your sybase database on unix, try checking that the SYBASE environmental variable is set correctly. I was getting connection errors until I found out that this variable had not been set through the server.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites