\PDO_mysql

Class PDO_mysql This class is used from class PDO to manage a MySQL database.

Look at PDO.clas.php file comments to know more about MySQL connection.

Summary

Methods
Properties
Constants
PDO_mysql()
close()
errorCode()
errorInfo()
exec()
lastInsertId()
prepare()
query()
quote()
getAttribute()
setAttribute()
beginTransaction()
commit()
rollBack()
__setErrors()
__uquery()
$__connection
$__dbinfo
$__persistent
$__errorCode
$__errorInfo
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$__connection

$__connection : 

'Private' variables: __connection:Resource Database connection __dbinfo:Array Array with 4 elements used to manage connection __persistent:Boolean Connection mode, is true on persistent, false on normal (deafult) connection __errorCode:String Last error code __errorInfo:Array Detailed errors

Type

$__dbinfo

$__dbinfo : 

Type

$__persistent

$__persistent : 

Type

$__errorCode

$__errorCode : 

Type

$__errorInfo

$__errorInfo : 

Type

Methods

PDO_mysql()

PDO_mysql(  $host,   $db,   $user,   $pass) 

Public constructor: Checks connection and database selection new PDO_mysql( &$host:String, &$db:String, &$user:String, &$pass:String )

Parameters

$host
$db
$user
$pass

close()

close() 

NOT NATIVE BUT MAYBE USEFULL FOR PHP < 5.1 PDO DRIVER Public method Calls mysql_close function.

this->close( Void ):Boolean

errorCode()

errorCode() 

Public method: Returns a code rappresentation of an error this->errorCode( void ):String

errorInfo()

errorInfo() 

Public method: Returns an array with error informations this->errorInfo( void ):Array

exec()

exec(  $query) 

Public method: Excecutes a query and returns affected rows this->exec( $query:String ):Mixed

Parameters

$query

lastInsertId()

lastInsertId() 

Public method: Returns last inserted id this->lastInsertId( void ):Number

prepare()

prepare(  $query,   $array = array()) 

Public method: Returns a new PDOStatement this->prepare( $query:String, $array:Array ):PDOStatement

Parameters

$query
$array

query()

query(  $query) 

Public method: Executes directly a query and returns an array with result or false on bad query this->query( $query:String ):Mixed

Parameters

$query

quote()

quote(  $string) 

Public method: Quotes correctly a string for this database this->quote( $string:String ):String

Parameters

$string

getAttribute()

getAttribute(  $attribute) 

Public method: Quotes correctly a string for this database this->getAttribute( $attribute:Integer ):Mixed

Parameters

$attribute

setAttribute()

setAttribute(  $attribute,   $mixed) 

Public method: Sets database attributes, in this version only connection mode.

this->setAttribute( $attribute:Integer, $mixed:Mixed ):Boolean

Parameters

$attribute
$mixed

beginTransaction()

beginTransaction() 

commit()

commit() 

rollBack()

rollBack() 

__setErrors()

__setErrors(  $er) 

Parameters

$er

__uquery()

__uquery(  $query) 

Parameters

$query