Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevArticles:
SQL Server and PHP Play Nice
Oct 21, 2003 @ 12:07:12

If you've ever struggled with trying to get a stored procedure to work from PHP in a Microsoft SQL Server, then you might be in luck. DevArticles just might have what you're looking for - and it's easier than you thought.

In Executing Microsoft SQL Server Stored Procedure from PHP on Linux, the author steps you through the process of setting up your Apache web server along with PHP, and software called FreeTDS (a package for connecting to the SQL server). The real magic comes in when you modify the PHP source slightly to allow it to compile with the FreeTDS software to connect to the SQL server. Their configure string is pretty large, but could be pared down quite a bit for a typical system config. Once this is all changed and PHP is compiled, you should be able to use three functions to get the job done: mssql_bind(), mssql_execute(), and mssql_init().

Of course, this path is one of many ways to get the same job done, but it seems like a nice, clean, and simple way to include SQL server support in your PHP code.

tagged:

Link:


Trending Topics: