PHPDevShell 3.1.3-Stable
PHP OOP RAD Development Framework
PHPDS_pdoConnector Class Reference
Inheritance diagram for PHPDS_pdoConnector:
PHPDS_dependant iPHPDS_dbConnector

Public Member Functions

 free ()
 connect ()
 query ($sql)
 protect ($param)
 fetchAssoc ()
 seek ($row_number)
 numrows ()
 affectedRows ()
 returnSqlError ($query)
 debugInstance ($ignored=null)
 lastId ()
 rowResults ($row=0)
 startTransaction ()
 endTransaction ($commit=true)

Protected Attributes

 $dsn = ''
 $user = ''
 $password = ''
 $link = null
 $result

Detailed Description

NOTE: you're not supposed to deal with connectors any way

Author:
Greg

Member Function Documentation

affectedRows ( )

Return the number of affected rows in the result of the query

Date:
20101103
Version:
1.0
Author:
Jason
Returns:
integer, the number of affected rows
See also:
includes/PHPDS_db_connectoraffectedRows()

Implements iPHPDS_dbConnector.

connect ( )

Connect to the database server (compatibility method)

Date:
20110810
Version:
1.0
Author:
greg

Implements iPHPDS_dbConnector.

debugInstance ( ignored = null)

Debugging Instance.

Returns:
debug object

Reimplemented from PHPDS_dependant.

endTransaction ( commit = true)

Ends SQL transaction.

Parameters:
<type>$commit

Implements iPHPDS_dbConnector.

fetchAssoc ( )

Return the next line as an associative array

Date:
20100216
Version:
1.0
Author:
greg
Returns:
array, the resulting line (or false is nothing is found)
See also:
includes/PHPDS_db_connector#fetch_assoc()

Implements iPHPDS_dbConnector.

free ( )

Clears the current connection (useful for example if we're fetching one row at a time and we give up before the end)

Returns:
nothing

Implements iPHPDS_dbConnector.

lastId ( )

Simply returns last inserted id from database.

Date:
20100610 (greg) (v1.0.1) added $this->link
Version:
1.0.1
Author:
jason
Returns:
int

Implements iPHPDS_dbConnector.

numrows ( )

Return the number of rows in the result of the query

Date:
20100216
Version:
1.0
Author:
greg
Returns:
integer, the number of rows
See also:
includes/PHPDS_db_connectornumrows()

Implements iPHPDS_dbConnector.

protect ( param)

Protect a single string from possible hacker (i.e. escape possible harmfull chars)

Date:
20100216
Version:
1.0
Author:
greg
Parameters:
$paramstring, the parameter to espace
Returns:
string, the escaped string
See also:
includes/PHPDS_db_connectorprotect()

Implements iPHPDS_dbConnector.

query ( sql)

Actually send the query to MySQL (through $db)

Date:
20110810
Version:
1.0
Author:
greg
Parameters:
$sqlstring, the actual sql query
Returns:
php resource, the resulting resource (or false is something bad happened)

Implements iPHPDS_dbConnector.

returnSqlError ( query)

This method returns the last MySQL error as a string if there is any. It will also return the actual erroneous SQL statement if the display_sql_on_error property is set to true. This is very helpfull when debugging an SQL related problem.

Parameters:
stringThe actual query string.
Returns:
string
Version:
1.0.1
Date:
20100329 prevent an exception if display_sql_on_error is not set
Author:
Don Schoeman <titan@phpdevshell.org>
rowResults ( row = 0)

Will return a single row as a string depending on what column was selected.

Date:
17062010 (jason)
Version:
1.0
Author:
jason
Returns:
string
seek ( row_number)

Move the internal pointer to the asked line

Date:
20100216
Version:
1.0
Author:
greg
Parameters:
$row_numberinteger, the line number
Returns:
boolean, TRUE on success or FALSE on failure
See also:
includes/PHPDS_db_connectorseek()

Implements iPHPDS_dbConnector.

startTransaction ( )

Start SQL transaction.

Implements iPHPDS_dbConnector.


Field Documentation

$dsn = '' [protected]
$link = null [protected]
$password = '' [protected]
$result [protected]
$user = '' [protected]

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations