Problem with MSSQL connection using IP (PHP)
Okay, i know exactly what the problem is, but I cant seem to find a way to solve it.
I am making a new flyffWeb, and I created a registration script that works very smoothly (I've already registered some accounts myself) but my script fails when people from other computers try to use it.
The thing is that, as i said, I already figured out whats causing it, but I cant fix it, so, if anyone can help me... please... you guys might end up having a full as2+php+mssql site released ^^
This is my problem:
when i use the method @mssql_connect in php i use these configurations and it works wonders
PHP Code:
//SQL Server Configuration
$ipsv = "MYPC\SQLEXPRESS" ;
$user = "sa" ;
$pass = "password" ;
$connect = @mssql_connect($ipsv, $user, $pass) or die ("Server is not available!");
However, when i try to change the computer name to my IP adress it stops working and it doesen't connect anymore.
Do anyone know how to make it work with my ip instead of my computer name?
Re: Problem with MSSQL connection using IP (PHP)
try using 127.0.0.1\SQLEXPRESS
or you could just use your computer name, i dont see the big problem with it
Re: Problem with MSSQL connection using IP (PHP)
doesent work... i cant use the computer name if I host the site on a different place than the server
Re: Problem with MSSQL connection using IP (PHP)
Quote:
Originally Posted by
00darkfire00
doesent work... i cant use the computer name if I host the site on a different place than the server
In that case you can't use mssql_connect. For remote connection you have to use obdc_connect. So try this code
PHP Code:
//SQL Server Configuration
$ipsv = "ip:port" ;
$user = "sa" ;
$pass = "password" ;
$connect = obcd_connect($ipsv, $user, $pass) or die ("Server is not available!");
Note: For remote connections use obdc_connect();, but if the server it's in the same machine of the website, use mssql_connect();
Re: Problem with MSSQL connection using IP (PHP)
with this method will I still be able to use the mssql php methods or will I have to substitute them for obdc ones? (like mssql_select_db for example)
ps: thanks a load, I didnt know about this ^^