Executing SQL Server Stored Procedures With PHP (Page 1 of 6 )
http://www.microsoft.com/sql/downloads/default.aspIn my time as a web developer and database administrator, I've come to love the combination of PHP and Microsoft SQL Server to deliver dynamic content to my clients. I know that MySQL is the most popular database to use with PHP, but PHP includes support for many other databases, and I just happen to love the power and flexibility of SQL Server 2000.
Just like ASP and ASP.NET, PHP can also connect to an SQL Server database and execute queries and stored procedures. If you're not familiar with SQL Server, then you'd be unfamiliar with stored procedures. Basically, a stored procedure is a bunch of SQL queries grouped together that can be called kind-of like a function with input and output parameters. Stored procedures can return complete recordsets, just values, or both recordsets and values.
In this article we're going to look at how to equip your installation of PHP with SQL Server support, how to connect to an SQL Server 2000 database using PHP's set of mssql_xxx functions and also how to execute commands and stored procedures against that database, capturing the output parameters and recordsets returned from those stored procedures.
To get the most benefit from this article, you should be running PHP on a Windows server as well as SQL Server 2000 on either the same or a different PC. I will assume that the PC running SQL Server 2000 is the same one that you have installed PHP onto.
If you don't have a copy of SQL Server 2000, then you can download a free 120-day trial version here.