NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
mssql_connect() doesn't work within IDE ?


Joined: 28 Jul 2004
Posts: 4
Reply with quote
Crying or Very sad This code doesn't connect from within PhP-IDE but works outside the IDE.

Error: Warning: mssql_connect(): Unable to connect to server: 192.168.210.10

Environment: PhPEd 3.3.1 Build IDE on Windows XP SP1, MS SQL 2000 on Windows 2000 server.

Code:

<?php
$myServer = "192.168.210.10";
$myUser = "sa";
$myPass = "*****";
$myDB = "Northwind";
$s = @mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
$d = @mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");

?>
View user's profileFind all posts by HMVinkSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
It is clear, though.
Please remove @ before mssql_connect and let me see what warning is actually given.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jul 2004
Posts: 4
Reply with quote
Warning: mssql_connect(): Unable to connect to server: 192.168.210.10 in C:\Program Files\NuSphere\TechPlat\apache\htdocs\connect-sql.php on line 6
Couldn't connect to SQL Server on 192.168.210.10
View user's profileFind all posts by HMVinkSend private message


Joined: 28 Jul 2004
Posts: 4
Reply with quote
I installed everything on a new machine and the code runs fine IE6 but not in the IDE. Error: Fatal error: Call to undefined function: mssql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 6
View user's profileFind all posts by HMVinkSend private message


Joined: 28 Jul 2004
Posts: 4
Reply with quote
I found it: in Tools -> Settings -> Srv web server the location for php was not c:\php.....
View user's profileFind all posts by HMVinkSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
It would be sufficient if you took a look into phpinfo() Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
mssql_connect() doesn't work within IDE ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic