[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

pdo connection string to sqlserver

Posted on 2008-06-11
5
Medium Priority
?
1,066 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 1000 total points
ID: 21758834
0
 
LVL 9

Assisted Solution

by:Rob Siklos
Rob Siklos earned 1000 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 1000 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 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

650 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