5
Contributors
6
Replies
8
Views
6 Years
Discussion Span
Last Post by arajapandi
0
<?php
$user='cwarn23';
$password='password';
$database_name='cwarn_phpbb';
mysql_connect('localhost',$user,$password);
mysql_select_db($database_name);
0
<?php
$user='cwarn23';
$password='password';
$database_name='cwarn_phpbb';
mysql_connect('localhost',$user,$password);
mysql_select_db($database_name);

My dear i want to connect with Sql server not with Mysql...

0

My dear i want to connect with Sql server not with Mysql...

In that case replace localhost with the ip of the sql server's ip address and on the sql server admin panel allow remote sql then you should be able to perform remote sql tasks. If you need a hand enabling remote sql on your sql server then please describe what control panel you use, what php version your using and mysql version.

0

Hi Farhad,

Try with mssql_connect functions.

OR

If your server doen't have mssql installed then try with odbc connection...

Steps to use odbc
Goto control panel -> Administrative tools -> Data Sources (ODBC)-> click system DSN -> Create DSN for SQL Server

You can connect SQL server using the below functions ...
$conn = odbc_connect('System dsn name created using ODBC','usernmae', 'password');
$res = odbc_exec($conn,"SELECT * from ajaxmint");

This topic has been dead for over six months. 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.