Mysql DB adapter. More...
Public Member Functions | |
__construct ($server, $database, $user, $password) | |
Class constructor. | |
connect () | |
connect to the database | |
select () | |
Select the database. | |
close () | |
Close the connection. | |
escape ($item) | |
Escape the string to make it safe. | |
prepare ($sql) | |
Prepare a SQL statement. | |
is_table ($table_name, $database='') | |
Check the table exists. | |
parse_parameters ($sql, $data=array()) | |
Creates raw SQL string with parameters escaped. | |
execute ($sql, $data=null, $options=array()) | |
Execute a statement, with provided variables. | |
record ($sql, $data=array(), $options=array()) | |
Fetch the first row of a query. | |
records ($sql, $data=array(), $options=array()) | |
Fetch all rows of a query as an associative array. | |
value ($sql, $data=array(), $options=array()) | |
Fetch the first value of the first column from a query. | |
values ($sql, $data=array(), $options=array()) | |
Fetch the first column values for each row from a query as an array. | |
errors ($sql='') | |
Return errors from last PDO statement. | |
get_last_id () | |
Return last inserted id. | |
![]() | |
__call ($function, $params) | |
The 'magic' call method will get/set for us invoked when the interpreter can not find a method the user is asking for. | |
set_parameters ($arguments) | |
Set variables from an array to member fields requires $this->optional_arguments or $this->required_arguments to have been set by the subclass. |
Protected Attributes | |
$connection = '' | |
DB connection. | |
$server = '' | |
Database server. | |
$database = '' | |
Database. | |
$user = '' | |
User name. | |
$password = '' | |
Password. | |
![]() | |
$optional_arguments = array() | |
Array of options that can be set to variables. | |
$required_arguments = array() | |
Array of options that need to be set to variables. |
Mysql DB adapter.
Creates a connection to the database using basic mysql library function, and executes statements
Mysql_Adapter::__construct | ( | $server, | |
$database, | |||
$user, | |||
$password | |||
) |
Class constructor.
Connects to database and sets the database handle.