\JCORE\DATA\API\MySQLMySQL_connector

Interface MySQL_connector

Summary

Methods
Properties
Constants
__construct()
getDbType()
set_connection()
is_persistent()
verify_connection()
resultToAssoc()
raw()
retrieve()
update()
create()
delete()
__destruct()
$connection
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$dbType
$DSN
$host
$username
$password
$database
$persistent
N/A

Properties

$connection

$connection : string

stores the connection resource

Type

string

$dbType

$dbType : string

The data base "dbType" MYSQL/POSTGRES/.

..

Type

string

$DSN

$DSN : string

The Data Source Name

Type

string

$host

$host : string

The host name WITH PORT

Type

string

$username

$username : string

username

Type

string

$password

$password : string

password

Type

string

$database

$database : string

database.name

Type

string

$persistent

$persistent : boolean

persistent connection

Type

boolean

Methods

__construct()

__construct(  $DSN,   $config) : NULL

Constructor

Parameters

$DSN
$config

Returns

NULL

getDbType()

getDbType() : string

DESCRIPTOR: Get the "private" dbType

Returns

string —

$dbType

set_connection()

set_connection(\JCORE\DATA\API\MySQL\bool/string  $persistent = NULL) : NULL

DESCRIPTOR: This sets a connection resource

Parameters

\JCORE\DATA\API\MySQL\bool/string $persistent

pass TRUE/FALSE OR 'true' from ini [config.dbConnectionPool.ini]

Returns

NULL

is_persistent()

is_persistent() : boolean

DESCRIPTOR: This checks if a connection resource is persistent

Returns

boolean —

$this->persistent

verify_connection()

verify_connection() : NULL

DESCRIPTOR: VERIFIES A CONNECTION

Returns

NULL

resultToAssoc()

resultToAssoc(resource  $result, string  $query) : array

DESCRIPTOR: coverts a MYSQL result to an array

Parameters

resource $result
string $query

would rather not send the query (its unneeded for functionality) but we do want to know what happened if the convert to array failed

Returns

array —

$resultArray

raw()

raw(string  $query) : \JCORE\DATA\API\MySQL\$result

DESCRIPTOR: EXECUTE A QUERY raw string

Parameters

string $query

Returns

\JCORE\DATA\API\MySQL\$result

retrieve()

retrieve(string  $query, mixed  $args = false) : \JCORE\DATA\API\MySQL\$result

DESCRIPTOR: EXECUTE A SELECT if $args["returnArray"] === true the function will return the result as a PHP array

Parameters

string $query
mixed $args

Returns

\JCORE\DATA\API\MySQL\$result

update()

update(string  $query, array  $args = false) : \JCORE\DATA\API\MySQL\$result

DESCRIPTOR: EXECUTE AN UPDATE if $args["returnArray"] === true the function will return the number of affected rows as well as the "mysql_info" from the query

Parameters

string $query
array $args

Returns

\JCORE\DATA\API\MySQL\$result

create()

create(string  $query, array  $args = false) : \JCORE\DATA\API\MySQL\$result

DESCRIPTOR: EXECUTE AN INSERT if $args["returnArray"] === true the function will return the "mysql_insert_id" the number of "mysql_affected_rows" as well as the "mysql_info" from the query

Parameters

string $query
array $args

Returns

\JCORE\DATA\API\MySQL\$result

delete()

delete(string  $query, array  $args = false) : \JCORE\DATA\API\MySQL\bool/array

DESCRIPTOR: EXECUTE A DELETE if $args["returnArray"] === true the function will return the number of affected rows as well as the "mysql_info" from the query

Parameters

string $query
array $args

Returns

\JCORE\DATA\API\MySQL\bool/array —

$result

__destruct()

__destruct() : null

DESCRIPTOR: __destruct if $args["returnArray"] === true the function will return the number of affected rows as well as the "mysql_info" from the query

Returns

null