I work primarly with PHP & MySQL, but I have a potential client with a MS SQL and ASP setup. Due to some complicated reasons and offline software integration, they need to keep the databases in the same format, which means not moving to MySQL which would be my personal preference.
So the question is can I use PHP to access and manipulate an MS SQL database or am I screwed on this one?
Thanks in advance
Yes, you can. It depends on which version of PHP you're using, but if you're using PHP5+ you can use Microsoft's SQL Server Driver for PHP. Make sure you use version 2, which gives you the PDO functionality as well as the procedural style.
You can also use the PDO ODBC driver to access a SQL Server instance, but that approach is more buggy and I don't recommend it.
Finally you can use the PHP MSSQL library but that's even worse. Go with Microsoft's own solution if you can.
Edit: Oh, and there's also the DBLIB MSSQL PDO driver - stay away from that one too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With