Function Reference / query – ezSQL

Description

query is an underlying basic method of ezSql Class to run any query which is not handled by existing ezSql methods of get_results, get_row, get_var. This function can be used to run SQL queries like insert, delete, update, replace, truncate, drop or create.

Format

<?php query($query); ?>

Parameters

$query (required)

(string) The query you want to run.

 

Usage

<?php  
$db = new ezSQL_mysql('db_user','db_password','db_name','db_host');
$db->query(" UPDATE users SET first_name='Fiaz' WHERE user_id = 1 ");
?>

Returns

This function returns the number of rows affected by the query.