Opens a Sybase server connection
(PHP 4, PHP 5)
Example 2523. sybase_connect() example
Code Examples / Notes » sybase_connect
To decrease the level of messages sent back from the dbserver (such as 'changed context...') try:
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 !
Set the appname using the 5th optional parameter:
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.
martin dot man
if you are going to use DSO version of php compiled with sybase support, check that apache is not linked against libdb2. In such case call to dbopen from libsybdb.so will result in a call to dbopen from libdb2.so which is loaded earlier that libsybdb.so, as a workaround either recompile apache without db2 support or link php staticaly with libsybdb.a.
the symptom of wrong behavior is that sybase_connect does not return neither 0 nor meaningful value, it simply returns nothing...
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:
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.