Login   Register  
PHP Classes
elePHPant
Icontem

File: example_delete.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Evert Ulises German Soto  >  PDO Multi Connection Class  >  example_delete.php  >  Download  
File: example_delete.php
Role: Example script
Content type: text/plain
Description: example_delete.php
Class: PDO Multi Connection Class
Access different types of SQL database using PDO
Author: By
Last change:
Date: 2012-08-08 15:28
Size: 510 bytes
 

Contents

Class file image Download
<?php
require("pdo_database.class.php");

$db = new wArLeY_DBMS("mysql""127.0.0.1""test""root""""");
$dbCN $db->Cnxn(); //This step is really neccesary for create connection to database, and getting the errors in methods.
if($dbCN==false) die("Error: Cant connect to database.");
echo 
$db->getError(); //Show error description if exist, else is empty.

$result $db->query("DELETE FROM TB_USERS WHERE ID=2;");
$getAffectedRows $db->delete("TB_USERS""ID=1");
$db->disconnect();
?>