PHP05 - Database

Database Integration - Microsoft SQL for PHP 5.3 or later

Things get a bit complicated after PHP 5.3. Microsoft SQL server is not supported by PHP 5.3 or later versions. So we need a "SQL Server Driver for PHP 1.1" from Microsoft.

1. Download "SQL Server Driver for PHP 1.1 - October 2009"

2. Run the .exe file and extract the files to a temporary location, say c:\temp

3. Copy php_sqlsrv_53_ts_vc9.dll to php/ext directory (if you downloaded/installed VC9 x86 versions for PHP 5.3)

3. update php.ini add "extension=php_sqlsrv_53_ts_vc9.dll"

4. restart Apache

5. code php

Some web help/tutorial links: link 1, link 2, link 3

eg0070_connect.php connect to MS SQL database server and retrieve records including datetime eg0070_connect.txt
Create another user in MSSQL management studio, and grant privileges to the database

eg0071.php Connecting to the Database Server eg0071.txt only

Create a database called "sample" and a table named "domains" in MSSQL

create database sample;

use sample
Create table domains
domain VARCHAR (20),
sex CHAR (1),
mail VARCHAR (20),

eg0072.php Adding a row to a table eg0072.txt

eg0073.php Adding user input to database eg0073.txt

eg0074.htm + (calling) eg0074action.php do the same thing as eg0073.php, it is a better option to split it to two files, easier to manage eg0074.txt, eg0074action.txt

eg0075.php Deleting rows from a table eg0075.txt

eg0076.php Updating rows eg0076.txt