PHP DB Access Delete

 

- Info:

- This tutorial shows how to use PHP to DELETE from Access DB.

 

- Example:

- Create PHP Console Application Delete.php.

 

Delete.php

<?php

#CONNECT TO DB.

$db = 'D:\Temp\PHP\guestbook.mdb';

$conn = new COM('ADODB.Connection');

$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db");

#EXECUTE STATEMENT.

$sql = "DELETE FROM PEOPLE WHERE NAME='John'";

$rs = $conn->Execute($sql);

?>