Mysqli Execute Query Operation


Executes any mysql query and returns the result array(in case of select query). Use this for running any other queries that can't be run using the other select,insert,update,delete 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 "
parameter_values array Optional Value of parameters/columns passed parameter values are like array("Editor","Client")


         $sdb= new SimplifiedDB(); 
         $query="insert into user_roles (`role_name`,`role_description`) values(?,?)";
         $sdb->dbExecuteQuery($query,array("manager","manages user")); 


It will insert a new row in above example.In case of select query, returns the result set .


Debug Operation Result/Output
$sdb->query insert into user_roles (`role_name`,`role_description`) values(?,?)
$sdb->last_insert_id 30
$sdb->rows_affected 1
$sdb->message_info Connected to database

More Example

          // Example of running query without using parameter binding 
          $sdb= new SimplifiedDB(); 
          $query="insert into user_roles (`role_name`,`role_description`) values('editor','edit posts')";