Connecting to SQL Azure with PHP

To start, I would like to first say that although many PHP developers usually recommend MySQL as the accompanying database for PHP, it is not difficult to interface PHP with other databases such as SQL Azure, Microsoft’s cloud-based relational database offering. PHP connects with SQL Azure in a similar manner as how it does with Microsoft SQL Server, ie through an interface known as the Open Database Connectivity (ODBC), which is actually the standard software interface for accessing databases. Each platform and database has its own implementation following the ODBC standard but for this tutorial, I’ll focus on PHP. There are a few ways to connect your php site to MS SQL but the 2 main approaches are as shown in Figure 1.0. 1. Using the “php_mssql.dll” php extension requiring MS SQL Client Tools installed (Figure 1.0, right column). 2. Using the “sqlsrv” driver (“Microsoft Drivers for PHP for SQL Server”) requiring MS SQL Native Client installed (Figure 1.0, left column) ...

Connecting to SQL Azure with ASP.NET

Recently, I have been working with Windows Azure and SQL Azure for my new project and because of this, a good amount of developer friends came to me and wanted me to share more about it hence I decided to write it down as a blog post for anyone who is interested to know about it. What is SQL Azure? SQL Azure is Microsoft’s Relational Database offering on the Cloud. It is build from the foundation of SQL Server It helps to actually ease the provisioning and deployment of many databases. It is easily scalable per se. This blog post is going to show you how easy is it for you to connect to SQL Azure, it actually works the same way as a normal SQL Server Connection, the main difference is the connection string. The username is your username setup at SQL Azure @ Server name. You can download the full sample project with CRUD ( Create, Retrieve, Update, Delete ) at the end of this post. ...