PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

PDO::beginTransaction> <Large Objects (LOBs)
Last updated: Fri, 05 Sep 2008

view this page in

The PDO class

Introduction

Represents a connection between PHP and a database server.

Class synopsis

PDO
PDO {
PDO::__construct ( string $dsn [, string $username [, string $password [, array $driver_options ]]] )
bool PDO::beginTransaction ( void )
bool PDO::commit ( void )
string PDO::errorCode ( void )
array PDO::errorInfo ( void )
int PDO::exec ( string $statement )
mixed PDO::getAttribute ( int $attribute )
array PDO::getAvailableDrivers ( void )
string PDO::lastInsertId ([ string $name ] )
PDOStatement PDO::prepare ( string $statement [, array $driver_options ] )
PDOStatement PDO::query ( string $statement )
string PDO::quote ( string $string [, int $parameter_type ] )
bool PDO::rollBack ( void )
bool PDO::setAttribute ( int $attribute , mixed $value )
}

Table of Contents



add a note add a note User Contributed Notes
PDO
anrdaemon at freemail dot ru
22-Aug-2008 04:16
Keep in mind, you MUST NOT use 'root' user in your applications, unless your application designed to do a database maintenance.

And storing username/password inside class is not a very good idea for production code. You would need to edit the actual working code to change settings, which is bad.
schizo_mind at hotmail dot com
28-Jul-2008 01:00
<?php
class PDOConfig extends PDO {
   
    private
$engine;
    private
$host;
    private
$database;
    private
$user;
    private
$pass;
   
    public function
__construct(){
       
$this->engine = 'mysql';
       
$this->host = 'localhost';
       
$this->database = '';
       
$this->user = 'root';
       
$this->pass = '';
       
$dns = $this->engine.':dbname='.$this->database.";host=".$this->host;
       
parent::__construct( $dns, $this->user, $this->pass );
    }
}
?>

PDO::beginTransaction> <Large Objects (LOBs)
Last updated: Fri, 05 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites