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
1 |
<?php query($query); ?> |
Parameters
$query (required)
(string) The query you want to run.
Usage
1 2 3 4 |
<?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.