Login   Register  
PHP Classes
elePHPant
Icontem

File: exemplo.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vanio  >  Conexão com PDO no MySQL  >  exemplo.php  >  Download  
File: exemplo.php
Role: Example script
Content type: text/plain
Description: exemplo de uso da classe Sql com PDO
Class: Conexão com PDO no MySQL
Run MySQL queries and manage transactions with PDO
Author: By
Last change:
Date: 2014-01-30 10:12
Size: 429 bytes
 

Contents

Class file image Download
 <?php
 
include_once 'class.Sql.php';

    try{

      
$conn = new Sql();
      
$conn->open();
      
$insert   $conn->prepare("INSERT INTO usuario(fk_tipo, nome, td_cadastro) VALUES ('1', 'Vanio Almeida', NOW())");
      
$insert->execute();

      
$conn->commit();
      
$conn NULL;
     }
  catch(
Exception $e)
    {
      
$conn->rollBack();
      
$conn  NULL;
      echo 
$e->getMessage();
    }

    
?>