473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

mssql_connect problems

hi i'm new user of sql server......
before i used sql server,i'm mysql user..

at my program i have 2 server,so if i used mysql i used this :

$mysqli1 = mysqli_connect("$DbHostName1", "$DbUserName1", "$DbPassWord1", "$DatabaseName1");
$mysqli2 = mysqli_connect("$DbHostName2", "$DbUserName2", "$DbPassWord2", "$DatabaseName2");

so if i want to get query from server 2,i just do this :

$select = mysqli_query($mysqli2,"select * from `home`");

and if i want to get query from server 1,i do this :

$select = mysqli_query($mysqli1,"select * from `home`");

the problem is i want to change mysql to sql_server,so how to connect to 2 server like i do at mysql,and how to get the query ?


thanks...
Nov 27 '06 #1
2 1708
nobody can't help me ?

em....
Dec 1 '06 #2
iburyak
1,017 Expert 512MB
Try this syntax.
Replace needful

SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=servername;User ID=username;Password=password'
).databasename.dbo.tablename
Good luck.
Dec 1 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Håvard Olerud Eriksen | last post by:
I'm trying to connect to MSSQL server 2000 using IIS 6.0. The only way I've been able to connect, however, is by disabling anonymous access and setting mssql.secure_connection = On. If I try to...
0
by: Jochen Daum | last post by:
Hi, I'd like to use a DNS entry for the server name in mssql_connect. The documentation on php.net says, I have to specify the server name in the interfaces file (I assume...
4
by: Biffo | last post by:
I have PHP Version 5.0.3 installed on Windows XP Pro with IIS as the webserver. All is working well, except I get a - Fatal error: Call to undefined function mssql_connect() in...
2
by: elsC | last post by:
Bonjour, Je viens d'installer SQL Server 2000 Dev edition. J'ai créé des connexions sécurisées SQL Server et pourtant lorsque j'essaie de me connecter avec PHP (mssql_connect('localhost',...
2
by: David Haynes | last post by:
I can't seem to get the magic to work to connect to SQL Server via mssql_connect(). I can get odbc_connect to work just fine, but not mssql_connect. Could someone please post an example of how the...
6
by: spamguy21 | last post by:
I have a server with Windows 2000, PHP 5, IIS and SQL Server 2000 running. Individually, each works great. When trying to bring PHP and MSSQL together, though, I'm tearing my hair out...it just...
13
by: printline | last post by:
Hello I have problems connecting to my MSSQL through php. I have a microsoft windows server 2003, web edition with php5 installed and Microsoft SQL Server: SQL Server 2005 Express Edition as my...
4
by: aryan2cool | last post by:
hii all i am using php 5 and a warning has occured in my application " Warning: mssql_connect() : message: Login failed for user 'PAYDATA'. (severity 14) in C:\WINNT\Temp\tmpqjqokj.php on...
2
by: mirali00 | last post by:
Hello, This is a strange one! I'm getting blank results for mssql_connect. I created a simple testmssql.php page with the following code: <?php if (function_exists('mssql_connect')) {...
3
Ciary
by: Ciary | last post by:
hi all, i've encountered a new problem. i was trying to connect to a ms sql server (9.0) to connect i use this: mssql_connect("***.***.***.***","User","userpw"); and i got this error:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.