PHP-MSSQL Connectivity

Reply

Join Date: Jul 2009
Posts: 1
Reputation: rojanjcb is an unknown quantity at this point 
Solved Threads: 0
rojanjcb rojanjcb is offline Offline
Newbie Poster

PHP-MSSQL Connectivity

 
0
  #1
Jul 23rd, 2009
do anyone knows how to connect to a MS SQL server(database in internet,i have ip,db username and db password).i used mssql_connect from my PHP ,but how to activate it in windows or Ubutu.i download all dll files needed but i cant connect..pls help me....
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 39
Reputation: emiola is an unknown quantity at this point 
Solved Threads: 1
emiola emiola is offline Offline
Light Poster

Re: PHP-MSSQL Connectivity

 
0
  #2
Jul 23rd, 2009
How do you mean in Windows? It will be better understood if you will expantiaite on "activate it in windows or Ubutu". Do you want to connect to your database from your windows operating system such that you will be able to export/import data?
If yes, let the forum know.
Thank you.
O God! He that teaches man what he knows not, please grant us the solution.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 2
Reputation: tlore22 is an unknown quantity at this point 
Solved Threads: 0
tlore22 tlore22 is offline Offline
Newbie Poster

Re: PHP-MSSQL Connectivity

 
0
  #3
Jul 23rd, 2009
Have you checked that you have the latest ntwdblib.dll( this has solved my connection problem)? You should paste this dll over your dll's from apache and php(I think it can be found in two places). Restart apache
then use mssql_connect like this:
  1. $myServer = "xx.xx.xx.xx";
  2. $myUser = "sa";
  3. $myPass = "yyyyyyyyyyyyy";
  4. $myDB = "zzzzzzzzzzz";
  5.  
  6. //connection to the database
  7. $dbhandle = mssql_connect($myServer, $myUser, $myPass)
  8. or die("Couldn't connect to SQL Server on $myServer");
  9.  
  10. //select a database to work with
  11. $selected = mssql_select_db($myDB, $dbhandle)
  12. or die("Couldn't open database $myDB");

If it still does not work you should try to connect to the database through MS SQL Management Studio.
If it does not connect talk to the owner of the database
Last edited by peter_budo; Jul 24th, 2009 at 3:26 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC