Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
| Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 10th, 2006, 09:42 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default Connect to MSSQL using IP Address

Hi Everyone,

I need to establish a connection to a SQL Server instance, but all I have access to is the IP Address (+ user name and all that stuff). Can anyone help me construct the mssql_connect statement using the IP Address, if this is possible.

Thanks

Mike

Mike
EchoVue.com
__________________
Mike
EchoVue.com
  #2 (permalink)  
Old April 12th, 2006, 03:15 AM
Registered User
 
Join Date: Apr 2005
Location: New Delhi, Delhi, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!!

Try this...

<?php
$con = mssql_connect ("<ip of the server SQL>", "sa", "");
mssql_select_db ("<Data Base>", $con);
$sql= "SELECT * FROM <Table>";
$rs= mssql_query ($sql, $con);
echo "The field number one is: ";
echo mssql_result ($rs, 0, 0);
mssql_close ($con);
?>


For more help check out here

http://us3.php.net/mssql

-------
Thanks,
Umesh


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to MSSQL without PHP Library echovue Pro PHP 0 April 2nd, 2007 07:19 PM
how to connect to ms sql 2000 via ip address indraneel ASP.NET 2.0 Professional 1 October 18th, 2006 02:13 AM
Connect to MSSQL 2005 express salemkoten SQL Server 2005 2 October 11th, 2006 04:46 AM
Help!!!! MSSQL will not connect jts7979 Classic ASP Databases 1 December 12th, 2004 11:34 PM
Retreiving IP address & gateway address sjangit VBScript 0 February 3rd, 2004 02:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.