Skip to content

Using SQL method in database class

minhaz edited this page Jun 9, 2015 · 1 revision

##database::SQL($query, $args = array())

###Arguments: $query The unprepared sql query of format SELECT * FROM admin WHERE email = ?

$args An array used for binding. First element of array should be the type specifier, and rest should be data values. In this case the $args array would look like array('s', '[email protected]'). Note: this field can be left blank if a prepared $query is used.

###Return Values: SELECT: an array of associative array. Example

array(
 [0] => array('name' => 'minhaz', 'age' => 20),
 [1] => array('name' => 'ashish', 'age' => 19),
 [2] => array('name' => 'anshuman', 'age' => 19)
)

Returns empty array in case of no rows returned.

UPDATE or DELETE: no of rows updated

INSERT or others: null is returned for now

Clone this wiki locally