Jump to content

multiple connections using mssql_connect()


manishtyagi83

Recommended Posts

Hi everyone,

 

I have written a script to do multiple connections with mssql server. To accomplish this I do mssql_connect(servername, username, pass, 1) in a loop which runs 50 times. But always after 25 iterations, my script fails to make a connection. I am doing this from APTANA IDE using the php5.3.3(CGI) plugin on my desktop.

 

Can someone please let me know what I am missing here?

 

Thanks,

Manish

Link to comment
Share on other sites

Thanks MrAdam for the reply!

 

Following is some logging information:

 

For 25 iterations:

 

I don't get any warnings and mssql_get_last_message() gives "Changed database context to 'master'"

 

After 25 iterations:

 

I start getting a warning i.e.  mssql_connect() [<a href='function.mssql-connect'>function.mssql-connect</a>]: Unable to connect to server:'server name'

 

and mssql_get_last_message() gives "Changed database context to 'database name'"

 

 

Thanks

 

 

Link to comment
Share on other sites

This is a remote server. I am not closing the connection in same loop as the whole purpose of script was to have multiple connections open but I just tried it now and it doesn't throw that error. I am trying to get hold of someone from network team to check if there is any connection limit imposed on servers.

 

Thanks for the suggestion!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.