Welcome to WebmasterWorld Guest from 54.226.241.8

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP, PDO, ODBC and MSSQL

It just seems impossible

     

ahmedtheking

2:03 pm on Mar 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Days like this makes me loathe Microsoft!

I'm trying to connect to a MSSQL Server (2005 Express) through PHP. I understand that the mssql_connect() and the php_mssql.dll are old and shouldn't be used, so the next best thing is PDO's MSSQL extension. It's a pain, and that doesn't seem to work either. So then I've gone and got PDO's ODBC extension and am trying to set up a DSN for the connect, but I can't figure it out, is this right:

new PDO('odbc:database=somedb;UID=someuid;PWD=somepwd;DSN=myDSNConn');

Any ideas?

vincevincevince

6:48 am on Mar 21, 2008 (gmt 0)

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Most people quickly migrate their database to MySQL or Postgresql and be done with it. One painful conversion for a lifetime of ease to follow!

ahmedtheking

11:30 am on Mar 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



MySQL is installed as a service, but I'm trying to connect to 2005 SQL server because an ASP.NET based web site uses that database.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month