mysqli_query
mysqli_query — Performs a query on the database.Description
mysqli_query( mysqli $mysql,Performs a query against the database. For non-DML queries (not INSERT, UPDATE or DELETE), this function is similar to calling mysqli_real_query() followed by either mysqli_use_result() or mysqli_store_result().
string $query,
int $result_mode = MYSQLI_STORE_RESULT ): mysqli_result|bool
Parameters
mysql
Procedural style only: A mysqli object returned by mysqli_connect() or mysqli_init()
query
The query string.
result_mode
The result mode can be one of 3 constants indicating how the result will be returned from the MySQL server.
MYSQLI_STORE_RESULT (default) - returns a mysqli_result object with buffered result set.
MYSQLI_USE_RESULT - returns a mysqli_result object with unbuffered result set. As long as there are pending records waiting to be fetched, the connection line will be busy and all subsequent calls will return error Commands out of sync. To avoid the error all records must be fetched from the server or the result set must be discarded by calling mysqli_free_result().
MYSQLI_ASYNC (available with mysqlnd) - the query is performed asynchronously and no result set is immediately returned. mysqli_poll() is then used to get results from such queries. Used in combination with either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT constant.
Return Values
Returns false on failure. For successful queries which produce a result set, such as SELECT, SHOW, DESCRIBE or EXPLAIN, mysqli_query() will return a mysqli_result object. For other successful queries, mysqli_query() will return true.More information about mysqli_query on official PHP documentation site
mysqli_query - Popular snippets
- PHP 7.4 / MySQL 5.7 mysqli_query mysqli_num_rows ceil print_r
last run:
2024-09-03 16:55:19
182
- PHP 5.6 / MySQL 5.7 mysqli_query mysqli_num_rows ceil print_r
last run:
2024-09-03 16:55:18
181
- PHP 8.0 / MySQL 5.7 mysqli_query mysqli_num_rows ceil print_r
last run:
2024-09-03 16:55:20
181
- PHP 8.1 / MySQL 5.7 mysqli_query mysqli_num_rows ceil print_r
last run:
2024-09-03 16:55:21
178
- PHP 7.4 / MySQL 8.0 mysqli_query mysqli_fetch_assoc explode count array_push trim array_count_values array_keys print_r
last run:
2023-06-06 16:46:02
15
- PHP 8.2.13 / MySQL 8.0 mysqli_query var_dump
last run:
2024-07-19 13:36:02
14
- PHP 8.1 / MySQL 5.7 session_start header mysqli_query
last run:
2023-04-21 15:17:01
13
- PHP 8.1 / MariaDB 10 mysqli_query print_r
last run:
2024-06-24 03:55:31
13
- PHP 8.0 / MySQL 5.7 mysqli_query
last run:
2023-07-24 13:56:04
12
- PHP 8.0 / MySQL 8.0 mysqli_query mysqli_num_rows mysqli_fetch_assoc
last run:
2022-02-16 13:43:51
10
mysqli_query - New snippets
-
PHP 8.1 / MySQL 5.7 mysqli_prepare mysqli_query mysqli_close
added at:
2024-11-18 23:13:08
1
-
PHP 8.1 / MySQL 5.7 mysqli_query mysqli_error mysqli_fetch_assoc
added at:
2024-11-15 16:05:00
1
-
PHP 8.1 / MySQL 5.7 printf mysqli_query
added at:
2024-11-04 05:33:22
1
-
PHP 5.6 / MySQL 8.0 mysqli_query mysqli_fetch_assoc
added at:
2024-11-03 07:38:43
1
-
PHP 5.6 / MySQL 8.0 mysqli_query mysqli_fetch_assoc
added at:
2024-11-03 07:02:05
2
-
PHP 7.4 / MySQL 8.0 mysqli_query mysqli_fetch_assoc
added at:
2024-11-03 07:00:56
2
-
PHP 8.1 / MySQL 5.7 mysqli_query
added at:
2024-10-27 11:28:39
1
-
PHP 8.1 / MySQL 5.7 mysqli_query
added at:
2024-10-27 11:28:33
1
-
PHP 8.1 / MySQL 5.7 mysqli_query
added at:
2024-10-27 11:27:44
1
-
PHP 8.1 / MySQL 5.7 mysqli_query
added at:
2024-10-27 11:27:19
1