PHP Classes

File: example_insert.php

Recommend this page to a friend!
  Classes of Evert Ulises German Soto   PDO Multi Connection Class   example_insert.php   Download  
File: example_insert.php
Role: Example script
Content type: text/plain
Description: example_insert.php
Class: PDO Multi Connection Class
Access different types of SQL database using PDO
Author: By
Last change:
Date: 10 years ago
Size: 676 bytes


Class file image Download

$db = new wArLeY_DBMS("mysql", "", "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.");
$db->getError(); //Show error description if exist, else is empty.

$result = $db->query("INSERT INTO TB_USERS (NAME, ADDRESS, COMPANY) VALUES ('Evert Ulises German', 'Internet #996 Culiacan Sinaloa', 'Freelancer');");
$result = $db->insert("TB_USERS", "NAME='Yusef German',ADDRESS='Tetameche #3035 Culiacan Sin. Mexico',COMPANY='Aluminium'");