0

danni web has been a great help to me i want just one more help

i am able to connect to MSSQL present in my localhost using wamp

but i am unable to connect to my MSSQL running in a pc with ip 123.xxx.xxx.xxx

can u guide me on how to connect to it..!

thanx in advance

Edited by daneuchar: topic header miss read

4
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by daneuchar
0

oops , you can simply connect it using the connect function like below -

$con = mssql_connect($server_name,$username,$password);
$db_select = mssql_select_db($database_name);

you must have understood that, in the mssql_connect function, you need to provide the server's name at first parameter and so on.
put that ip there and it should work.

0

You may Use the Belwo Specified Code:

$hostname = "123.xxx.xxx.xxx"; // usually is localhost, but if not sure, check with your hosting company, if you are with webune leave as localhost 
$db_user = "username"; // change to your database password 
$db_password = "password"; // change to your database password 
$database = "database_name"; // provide your database name 

# STOP HERE 
#################################################################### 
# THIS CODE IS USED TO CONNECT TO THE MSSQL DATABASE 
$db = mssql_connect($hostname, $db_user, $db_password);
mssql_select_db($database,$db); //Database Connect

EDIT: Sorry Code Edited for Some Error.

Edited by hemgoyal_1990: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.