If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member drews's Avatar
    Join Date
    Nov 2002
    St. Petersburg, Florida
    Member #
    Hi all long time no post,

    I am running PHP 5.2.5 on Windows Server 2003, and Microsoft SQL Server 2005.

    I would like to install the PDO extension on PHP and use it for connecting to and interacting with SQL Server (as well as MySQL).

    I know I need to install the base PDO extension, but then there I get confused on PDO driver to load for interaction with MSSQL. tells me that the DBLIB extension on windows is not good, and that I should use PDO_ODBC. Then researching this some more, I see some sites referencing PDO_
    MSSQL, but I can't find this anywhere on's site.

    So after I load the appropriate driver, what would my initial connection string look like? Some sites, load the odbc driver and then call something like:
    PHP Code:
    $dbh = new PDO('mssql:host=localhost;dbname=test'$user$pass); 
    but other sites use ODBC instead of MSSQL, and some sites use DBLIB.

    So if someone can clarify with extension to use and then what the appropriate initial connection would look like, I would really appreciate it.

    -White Fiber Hosting - Coming Soon!


  3. #2
    Junior Member
    Join Date
    Dec 2002
    chennai , tamil nadu , India
    Member #
    If you have already created the data source name then

    odbc_connect("$dsn",$user,$password) should do it !
    Chris, Developer,
    Software developers,
    Php and RoR programmers,

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 02:55 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: