What is the difference between mysqli::query
and mysqli::real_query
?
OR
What is the difference between mysqli_query
and mysqli_real_query
?
The query() / mysqli_query() function performs a query against a database.
Mysqli_connect doesn't target the table and mysqli_query doesn't output anything.
PHP uses mysqli query() or mysql_query() function to create or delete a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure.
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 .
mysqli::query
will return a result if there is any.
mysql::real_query
will return true on success or false if not
You could have seen this in the php doc:
Look at the documentation of mysqli_query():
Functionally, using this function is identical to calling mysqli_real_query() followed either by mysqli_use_result() or mysqli_store_result().
From what I understand real_query actually executes the query, and use/store_result initiates the process of retrieving a result set for the query. query() does both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With