How to connect remote mssql

Thread Solved

Join Date: Sep 2009
Posts: 11
Reputation: daneuchar is an unknown quantity at this point 
Solved Threads: 0
daneuchar daneuchar is offline Offline
Newbie Poster

How to connect remote mssql

 
0
  #1
Oct 27th, 2009
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
Last edited by daneuchar; Oct 27th, 2009 at 8:56 am. Reason: topic header miss read
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #2
Oct 28th, 2009
do your sql manager supports ssh
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 11
Reputation: daneuchar is an unknown quantity at this point 
Solved Threads: 0
daneuchar daneuchar is offline Offline
Newbie Poster
 
0
  #3
Oct 28th, 2009
How to check that sir ?
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #4
Oct 29th, 2009
oops , you can simply connect it using the connect function like below -
  1. $con = mssql_connect($server_name,$username,$password);
  2. $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.
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 130
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Solved Threads: 8
hemgoyal_1990's Avatar
hemgoyal_1990 hemgoyal_1990 is offline Offline
Junior Poster
 
0
  #5
Oct 29th, 2009
You may Use the Belwo Specified Code:

  1. $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
  2. $db_user = "username"; // change to your database password
  3. $db_password = "password"; // change to your database password
  4. $database = "database_name"; // provide your database name
  5.  
  6. # STOP HERE
  7. ####################################################################
  8. # THIS CODE IS USED TO CONNECT TO THE MSSQL DATABASE
  9. $db = mssql_connect($hostname, $db_user, $db_password);
  10. mssql_select_db($database,$db); //Database Connect

EDIT: Sorry Code Edited for Some Error.
Last edited by hemgoyal_1990; Oct 29th, 2009 at 4:19 am.
http://www.kuchamancity.com
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 557
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 64
network18 network18 is offline Offline
Posting Pro
 
0
  #6
Oct 29th, 2009
he wants to connect to the microsoft's SQL server and not MySQL
"The discipline of writing something down is the first step towards making it happen."

follow me on twitter
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 130
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Solved Threads: 8
hemgoyal_1990's Avatar
hemgoyal_1990 hemgoyal_1990 is offline Offline
Junior Poster
 
0
  #7
Oct 29th, 2009
Sorry Friend.

am Edit my Code.

Thanx for Your Suggestion.
http://www.kuchamancity.com
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 3
Reputation: fanza is an unknown quantity at this point 
Solved Threads: 1
fanza fanza is offline Offline
Newbie Poster
 
0
  #8
Oct 29th, 2009
hey i hope you have got you answer. its so useful postings.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 11
Reputation: daneuchar is an unknown quantity at this point 
Solved Threads: 0
daneuchar daneuchar is offline Offline
Newbie Poster

Thanx a lot

 
0
  #9
Nov 3rd, 2009
Thanx a Lot guys !! U all ROCK
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 350 | Replies: 8
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC