PDO Execute Query Operation


Executes any mysql query and returns the result (returns array in case of select query). Use this for running complex queries that can't be run using the other select,insert,update,delete,join functions

Function Reference :
mixed dbExecuteQuery(string $query [, array $parameter_values=array()]) 


Name Type Required Parameter Info Example
query string Yes Query to be executed $query="select firstName,lastName,email from users where gender='?'"
parameter_values array Optional Array with values of columns in query(pass column values as parameter values to use binding) e.g. array("male");


            $sdb= new SimplifiedDB();
            $query="select firstName,lastName,email from users where gender=?";


Executes the query.You can use this function to execute very complex queries like queries using varibles,multiple select statement in one query etc.
If query is select operation then it will return output in associative array(default). You can change it using Fetch mode as explained in previous select operations.


Debug Operation Result/Output
$sdb->query select firstName,lastName,email from users where gender=?
$sdb->message_info Connected to database

More Examples

            $query="select firstName,lastName,email from users where gender=? and role_id=?";