Search code examples
phpmysqli

difference between mysqli_query and mysqli_real_query


What is the difference between mysqli::query and mysqli::real_query?

OR

What is the difference between mysqli_query and mysqli_real_query?


Solution

  • Look at the documentation of mysqli_query():

    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().

    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.