4

I just received an email from our host and they've upgraded our PHP to 5.3, unfortunately though, all the scripts have now broken. I traced it down to the function mssql_connect failing. Support told me this has now been deprecated under 5.3 - how can this be true?

How can you connect to a mssql database under PHP 5.3 now??

JCraine
  • 1,159
  • 2
  • 20
  • 38
  • 2
    [Recommended method](http://php.net/manual/en/ref.pdo-sqlsrv.php) - [Other method](http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx) (although they both use the same driver, PDO is "the PHP way") – DaveRandom Jun 28 '12 at 12:18

2 Answers2

3

http://www.php.net/manual/en/intro.mssql.php

"This extension is not available anymore on Windows with PHP 5.3 or later."

Maybe you should look into converting your app to use PDO: http://www.php.net/manual/en/ref.pdo-sqlsrv.php

Gabriel Baker
  • 1,209
  • 11
  • 21
  • 3
    I think he knows that. This doesn't answer the `How can you connect to a mssql database under PHP 5.3 now?` question though, which is what really matters. – DaveRandom Jun 28 '12 at 12:22
0

If you see such a warning, the first place to visit is the PHP documentation.

From http://php.net/manual/en/intro.mssql.php:

Introduction

These functions allow you to access MS SQL Server database.

This extension is not available anymore on Windows with PHP 5.3 or later.

SQLSRV, an alternative driver for MS SQL is available from Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx.

Lekensteyn
  • 64,486
  • 22
  • 159
  • 192