Solved

pdo connection string to sqlserver

Posted on 2008-06-11
5
1,064 Views
Last Modified: 2008-06-16
hi all,
does pdo supports sqlserver to connect to if so please send me the pdo statement that support it  on php 5.2
please reply as soon as possible
best regards
mohr4000
0
Comment
Question by:mohr4000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 250 total points
ID: 21758834
0
 
LVL 9

Assisted Solution

by:Rob Siklos
Rob Siklos earned 250 total points
ID: 21760492
If you are running php on Windows, DO NOT use the PDO_DBLIB driver.  From the web page:

"On Windows, you should use the PDO_ODBC  driver to connect to Microsoft SQL Server and Sybase databases, as the native Windows DB-LIB is ancient, thread un-safe and no longer supported by Microsoft. "

So, if you *are* running PHP on Windows, set up an ODBC connection to your SQL Server, and use the PDO_ODBC driver to connect.

Let me know if you need more info.
0
 

Author Comment

by:mohr4000
ID: 21760811
hi rob263,
thanks for reply,
but I'm using linux fedora core does dblib works fine on it to connect to MSSQLSERVER
if not do you have another way
best regards
hatem
0
 
LVL 9

Assisted Solution

by:Rob Siklos
Rob Siklos earned 250 total points
ID: 21760878
Well, in addition to the warning about not using it on Windows, the page does say (in a big red box) that the extension is Experimental.  I would still try it though, since it uses FreeTDS, which has been around for a while.

If it doesn't work, you can always fall back on ODBC, but even that may have problems (see http://www.php.net/manual/en/ref.pdo-odbc.php#81488)
0
 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 250 total points
ID: 21767009
Yes pdo-dblib can be compiled against free tds on linux to connect to a windows SQl-Server. It's described in my first link.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question