Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php mssql connection - Intermittently Connects???
Old 02-26-2008, 02:08 PM php mssql connection - Intermittently Connects???
Junior Talker

Posts: 2
Trades: 0
We have created some very simple php pages to see if the code can retrieve data from our SQL Server, and they do successfully query the database and return data, BUT, only about 2 out of 10 times on a browser refresh. The rest of the times we get a "Unable to connect to server: localhost,1433" error.

This, of course, has us very confused. I'd almost rather not be able to connect at all as it would make more sense.

If you are able to provide any insight into what might be happening with our setup, it would be MUCH appreciated. We are running MSSQL 8.00.818, PHP Version 5.2.5, and IIS 6.

Thanks in advance.
redherring is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-26-2008, 03:15 PM Re: php mssql connection - Intermittently Connects???
dlaroche22's Avatar
Skilled Talker

Posts: 84
Name: Dustin Laroche
Trades: 0
Well from what I gather, if you are able to connect sometimes then the problem isn't with your PHP code, therefor, this post should be moved. However, I will try to offer some help in areas to look to help solve the problem.
  • Check any firewall settings to make sure they are not interfering with the connection ( I doubt this will help, because a firewall would completely block all connections, but worth checking out first ).
  • Check your MSSQL settings, because it kinda looks like when you refresh you are causing multiple connections which in turn causes the error. So your MSSQL settings could be configured wrong. MSSQL is a beast to configure compared to other databases so look into this one well.
  • Also the problem could lie in your IIS configuration settings. I'm not very familiar with configuring IIS so this is something you will have to look into on your own.
The problem does not seem to be comming from your PHP code so the problem lies somewhere with MSSQL or IIS. A google for "MSSQL connection problems" returned a good site that might help you out also http://www.databasejournal.com/featu...le.php/1569851

I hope this helps point you in the right direction to fixing your problem!!
__________________
Under Construction, But A Work In Progress
Webhosting isn't cheap, sponsors are important

Please login or register to view this content. Registration is FREE
dlaroche22 is offline
Reply With Quote
View Public Profile
 
Old 02-27-2008, 11:52 AM Re: php mssql connection - Intermittently Connects???
Junior Talker

Posts: 2
Trades: 0
Wow...

mssql_pconnect vs. mssql_connect

The "pconnect" works while just the "connect" doesn't.

While I'd love to know the "why" of it, I am ecstatic for now that things seem to be working.
redherring is offline
Reply With Quote
View Public Profile
 
Old 02-27-2008, 04:00 PM Re: php mssql connection - Intermittently Connects???
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
According to php.net the p stands for persistent.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to php mssql connection - Intermittently Connects???
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13618 seconds with 12 queries