PHP mysqli_query() Function

PHP mysqli_query() function is used to performs a query on the database.

Syntax

mysqli_query() Function Parameter

ParameterDescription
connection :Required parameter. The MySQL connection to be used
query :Required parameter. The query string
resultmode :Optional parameter. Either the constant MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT depending on the desired behavior. By default, MYSQLI_STORE_RESULT is used.

mysqli_query() Function Return Value

Return Values :Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object.

mysqli_query() Function Example