\Pluf_DB_MySQL

MySQL connection

Summary

Methods
Properties
Constants
__construct()
database()
getServerInfo()
debug()
close()
select()
execute()
getLastID()
getError()
getErrorNumber()
throwError()
esc()
qn()
begin()
commit()
rollback()
__toString()
$con_id
$pfx
$lastquery
$engine
$type_cast
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$debug
N/A

Properties

$con_id

$con_id : 

Type

$pfx

$pfx : 

Type

$lastquery

$lastquery : 

اخرین کاوشی که اجرا می‌شود در این متغییر ذخیره می‌شود.

این کار در رفع خطا و یا گزارش خطا بسیار مناسب است.

Type

$engine

$engine : 

Type

$type_cast

$type_cast : 

Type

$debug

$debug : 

Type

Methods

__construct()

__construct(  $user,   $pwd,   $server,   $dbname,   $pfx = '',   $debug = false) 

Parameters

$user
$pwd
$server
$dbname
$pfx
$debug

database()

database(  $dbname) 

Parameters

$dbname

getServerInfo()

getServerInfo() : string

Get the version of the MySQL server.

Returns

string —

Version string

debug()

debug(  $query) : boolean

Log the queries.

Keep track of the last query and if in debug mode keep track of all the queries in $GLOBALS['_PX_debug_data']['sql_queries']

Parameters

$query

Returns

boolean —

true

close()

close() 

select()

select(  $query) 

Parameters

$query

execute()

execute(String  $query) : boolean

run a query

Parameters

String $query

Returns

boolean —

true if is success

getLastID()

getLastID() 

getError()

getError() : string

Returns a string ready to be used in the exception.

Returns

string —

Error string

getErrorNumber()

getErrorNumber() 

شماره خطای ایجاد شده را تعیین می‌کند.

throwError()

throwError() 

خطای مناسب با حالت سیستم ایجاد می‌کند.

Throws

\Pluf\Exception

esc()

esc(  $str) 

Parameters

$str

qn()

qn(  $col) : string

Quote the column name.

Parameters

$col

Returns

string —

Escaped name

begin()

begin() 

Start a transaction.

commit()

commit() 

Commit a transaction.

rollback()

rollback() 

Rollback a transaction.

__toString()

__toString()