Issue on mssql_connect

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fcaserio
Forum Newbie
Posts: 6
Joined: Wed Jan 21, 2009 6:20 am

Issue on mssql_connect

Post by fcaserio »

I have an application which runs PHP and SQL Server

There is a Linux Server running redhat and PHP 5.1.6 and a Windows Server for SQL 2005.
On the last weeks the application started to return eventually mssql_connect erros, saying server is unavailable.
There is no network instability that we could map.

We've tried to replace mssql_connect with mssql_pconnect, but then the erros returned eventually were on mssql_select_db instead of mssql_connect.

I've discovered that PHP 5.1 added a new parameter [, bool $new_link ] on both mssql_connect and mssql_pconnect.

Documantation for new_link says:
If a second call is made to mssql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. This parameter modifies this behavior and makes mssql_connect() always open a new link, even if mssql_connect() was called before with the same parameters.
What is the best technique recommended to connect to SQL Server for a production server?
  • mssql_connect or mssql_pconnect?
  • new_link = true ou new_link = false?
tks for any help
Post Reply