943,983 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 900
  • PHP RSS
Oct 27th, 2009
0

How to connect remote mssql

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
daneuchar is offline Offline
30 posts
since Sep 2009
Oct 28th, 2009
0
Re: How to connect remote mssql
do your sql manager supports ssh
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Oct 28th, 2009
0
Re: How to connect remote mssql
How to check that sir ?
Reputation Points: 10
Solved Threads: 0
Light Poster
daneuchar is offline Offline
30 posts
since Sep 2009
Oct 29th, 2009
0
Re: How to connect remote mssql
oops , you can simply connect it using the connect function like below -
PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Oct 29th, 2009
0
Re: How to connect remote mssql
You may Use the Belwo Specified Code:

PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 18
Solved Threads: 17
Junior Poster
hemgoyal_1990 is offline Offline
175 posts
since Aug 2007
Oct 29th, 2009
0
Re: How to connect remote mssql
he wants to connect to the microsoft's SQL server and not MySQL
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Oct 29th, 2009
0
Re: How to connect remote mssql
Sorry Friend.

am Edit my Code.

Thanx for Your Suggestion.
Reputation Points: 18
Solved Threads: 17
Junior Poster
hemgoyal_1990 is offline Offline
175 posts
since Aug 2007
Oct 29th, 2009
0
Re: How to connect remote mssql
hey i hope you have got you answer. its so useful postings.
Reputation Points: 8
Solved Threads: 1
Newbie Poster
fanza is offline Offline
3 posts
since Oct 2009
Nov 3rd, 2009
0

Thanx a lot

Thanx a Lot guys !! U all ROCK
Reputation Points: 10
Solved Threads: 0
Light Poster
daneuchar is offline Offline
30 posts
since Sep 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Prevent a user from viewing the info
Next Thread in PHP Forum Timeline: Is this a PHP installation problem??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC