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, 01 Aug 2008

view this page in

The PDO class

Introducere

Represents a connection between PHP and a database server.

Sinopsisul clasei

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

Cuprins



add a note add a note User Contributed Notes
PDO
anrdaemon at freemail dot ru
22-Aug-2008 10: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 07: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, 01 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites