php and mssql on seperate servers
php and mssql on seperate servers
am 24.04.2008 19:49:22 von Rick Taylor
I'm new to PHP and having issues. We have seperate servers for them. We
can use ODBC to test the connection and it works fine. However, when we try
to run the site we get a message of *** Error: Unable to Connect to
Database. Please Try Again Later. ***
We are using a custom app that we aren't getting a lot of assistance with.
The relevant lines in the app are:
define("DBHOST", "//database server name");
define("DBUSER", "user");
define("DBPASS", "password");
if(!$dbCon=mssql_connect(DBHOST,DBUSER,DBPASS)) $error = "Unable to Connect
to Database. Please Try Again Later.";
Can anyone assist a noob php user?
thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: php and mssql on seperate servers
am 24.04.2008 20:54:31 von Peter Westergaard
Rick Taylor wrote:
> I'm new to PHP and having issues. We have seperate servers for them.
> We can use ODBC to test the connection and it works fine. However, when
> we try to run the site we get a message of *** Error: Unable to Connect
> to Database. Please Try Again Later. ***
>
> We are using a custom app that we aren't getting a lot of assistance
> with. The relevant lines in the app are:
> define("DBHOST", "//database server name");
> define("DBUSER", "user");
> define("DBPASS", "password");
>
> if(!$dbCon=mssql_connect(DBHOST,DBUSER,DBPASS)) $error = "Unable to
> Connect to Database. Please Try Again Later.";
>
> Can anyone assist a noob php user?
>
> thanks
Thanks for removing any extraneous/irrelevant code. Nice, well-laid-out
question.
The obvious follow-up-question presents itself, so forgive me for asking
if I'm underestimating, but you didn't mention whether or not you were
quoting it verbatim, or whether you had replaced your database host,
userid, and password from the code before you pasted it here.
Just in case it's the really obvious problem, you should be aware that
you are expected to fill in those lines as relevant to your MSSQL server.
For example, if the MSSQL serer was living on a server called
"TORFOX001" (or "//TORFOX001" in the MS local-network naming format),
and you'd set it up with a userid "zippy" with password "pinh34d", those
lines should be modified to read:
define("DBHOST", "//TORFOX001");
define("DBUSER", "zippy");
define("DBPASS", "pinh34d");
-P
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: php and mssql on seperate servers
am 25.04.2008 06:19:16 von Bastien Koert
------=_Part_3605_28736737.1209097156649
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On Thu, Apr 24, 2008 at 2:54 PM, Peter Westergaard
wrote:
> Rick Taylor wrote:
>
>> I'm new to PHP and having issues. We have seperate servers for them. We
>> can use ODBC to test the connection and it works fine. However, when we try
>> to run the site we get a message of *** Error: Unable to Connect to
>> Database. Please Try Again Later. ***
>>
>> We are using a custom app that we aren't getting a lot of assistance with.
>> The relevant lines in the app are:
>> define("DBHOST", "//database server name");
>> define("DBUSER", "user");
>> define("DBPASS", "password");
>>
>> if(!$dbCon=mssql_connect(DBHOST,DBUSER,DBPASS)) $error = "Unable to
>> Connect to Database. Please Try Again Later.";
>>
>> Can anyone assist a noob php user?
>>
>> thanks
>>
>
> Thanks for removing any extraneous/irrelevant code. Nice, well-laid-out
> question.
>
> The obvious follow-up-question presents itself, so forgive me for asking if
> I'm underestimating, but you didn't mention whether or not you were quoting
> it verbatim, or whether you had replaced your database host, userid, and
> password from the code before you pasted it here.
>
> Just in case it's the really obvious problem, you should be aware that you
> are expected to fill in those lines as relevant to your MSSQL server.
>
> For example, if the MSSQL serer was living on a server called "TORFOX001"
> (or "//TORFOX001" in the MS local-network naming format), and you'd set it
> up with a userid "zippy" with password "pinh34d", those lines should be
> modified to read:
>
> define("DBHOST", "//TORFOX001");
> define("DBUSER", "zippy");
> define("DBPASS", "pinh34d");
>
> -P
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
You can also set the IP address of the MSSQL server as the host
--
Bastien
Cat, the other other white meat
------=_Part_3605_28736737.1209097156649--
Re: php and mssql on seperate servers
am 25.04.2008 12:26:36 von Rick Taylor
Thanks for the help everyone. It is now fixed. They guy that originally
set it up used the //servername. I removed the // and it works fine, until
it got to the next error. :)
This is going to take a while. I'm sure I'll be back with more questions.
"Peter Westergaard" wrote in message
news:EF.97.30653.277D0184@pb1.pair.com...
> Rick Taylor wrote:
>> I'm new to PHP and having issues. We have seperate servers for them. We
>> can use ODBC to test the connection and it works fine. However, when we
>> try to run the site we get a message of *** Error: Unable to Connect to
>> Database. Please Try Again Later. ***
>>
>> We are using a custom app that we aren't getting a lot of assistance
>> with. The relevant lines in the app are:
>> define("DBHOST", "//database server name");
>> define("DBUSER", "user");
>> define("DBPASS", "password");
>>
>> if(!$dbCon=mssql_connect(DBHOST,DBUSER,DBPASS)) $error = "Unable to
>> Connect to Database. Please Try Again Later.";
>>
>> Can anyone assist a noob php user?
>>
>> thanks
>
> Thanks for removing any extraneous/irrelevant code. Nice, well-laid-out
> question.
>
> The obvious follow-up-question presents itself, so forgive me for asking
> if I'm underestimating, but you didn't mention whether or not you were
> quoting it verbatim, or whether you had replaced your database host,
> userid, and password from the code before you pasted it here.
>
> Just in case it's the really obvious problem, you should be aware that you
> are expected to fill in those lines as relevant to your MSSQL server.
>
> For example, if the MSSQL serer was living on a server called "TORFOX001"
> (or "//TORFOX001" in the MS local-network naming format), and you'd set it
> up with a userid "zippy" with password "pinh34d", those lines should be
> modified to read:
>
> define("DBHOST", "//TORFOX001");
> define("DBUSER", "zippy");
> define("DBPASS", "pinh34d");
>
> -P
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php