My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 08, 2008 by Xeoncross
Getting_Started  

#Learn how to use each function.

How To Use CXPDO Functions

Each of the added functions CXPDO provides takes a series of parameters/arguments and returns a PDO Statement Object. Here is a list of all variables that CXPDO requires and what they are supposed to hold/be.

$conditions = Optional WHERE conditions for SQL query. Pass as an array or array of arrays:

$conditions = array(
'id' => 2,
'name' => array('sam', 'bob', 'john')
);
//Creates: WHERE id = '2' OR 'name' in('sam', 'bob', 'john')

$tables = string or array of table names that the query is affecting. In some cases only one table name is allowed.

$data = array where $key => $element. $key = column name and $element = data. For SELECT() function data contains an array of values about the query.

$replace = Should the term REPLACE be used instead of INSERT? TRUE/FALSE

$return = TRUE = DO NOT QUERY DB! Create query string and return it. (Default) FALSE = query db and return result. This is very handy for checking syntax and learning how to write SQL.

Insert($tables, $data, $replace, $return)

Replace($tables, $data, $return)

Alias for insert();

update($tables, $data, $conditions, $return)

delete($tables, $conditions, $return)

count($tables, $conditions, $return)

select($data, $return)


Sign in to add a comment
Hosted by Google Code