Windows XP sp2でPHP 5.2.9-2でSQL Server 2008に接続しようとしています。同じマシンからSQL Server Management StudioからリモートSQL Serverに接続できます。PDOでSQL Server 2008に接続
私の最初の試みは、このでした:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[0100] Unable to connect: SQL Server is unavailable or does not exist. Access denied. (severity 9)'
第二の試み(experts-exchangeで見つかった)
$conn = new PDO("odbc:Driver={SQL Server Native Client 10.0};Server={$host};Database={$db};Uid={$user};Pwd={$pass}",
$user, $pass);
これは動作しますが、私ができる」:このエラーが発生します
$conn = new PDO("mssql:host={$host};dbname={$db}", $user, $pass);
PDO::lastInsertId()
を使用してください。
Driver does not support this function: driver does not support lastInsertId()
ご意見はありますか?どんな助けでも大歓迎です。
ありがとうございます。他の質問には解決策はありませんでした。 Windows認証を使用するか、データベース用に作成したSQL Serverログインを使用してSQL Server Management Studioに接続できるため、混合モードが実行されています。 –