Definition and usage
mysqli_query() function executes a query against the database.
Syntax
mysqli_query(connection,query,resultmode);
Parameter description:
connection Required, specifies the MySQL connection to be used.
query Required, specifies the query string.
resultmode Optional. a constant. Can be any of the following values:
1.MYSQLI_USE_RESULT (use this if you need to retrieve a large amount of data)
2.MYSQLI_STORE_RESULT (default)
Return value:
For a successful SELECT, SHOW, DESCRIBE or EXPLAIN query, a mysqli_result object will be returned. For other successful queries, TRUE will be returned. On failure, returns FALSE.
Update log: The asynchronous query function is added in PHP 5.3.0.
PHP mysqli_query() function usage example:
Execute a query against the database:
Delete database
The above is the detailed content of PHP mysqli_query() function definition and usage. For more information, please follow other related articles on the PHP Chinese website!