Solved

pdo connection string to sqlserver

Posted on 2008-06-11
5
1,049 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
  • 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now