Using real_query()


show more Using real_query() provides you with in-depth training on Developer. Taught by David Powers as part of the Accessing Databases with Object-Oriented PHP show less
please wait ...

Using real_query()

In addition to the query method, MySQLi has the rather oddly named real query method. With the select statement, the query method executes the query and returns a MySQLi result object, with the result set stored in PHP memory, ready for use. The real query method on the other hand, simply submits the query. You need to retrieve the result set separately. This is mysqli_real_query.php, which you can find in the chapter 7 07_02 folder of the Exercise Files.

And we'll use this to experiment with the differences between query and real query. At the top of the page, there are two select queries that are executed one after the other using the query method. And the first result is stored as result. The second one as result2. Down in the page, two while loops display the different results. And if we load that page into a browser, we can see the two different result sets being displayed. So, let's change the first one to real query.

So we need to scroll up, and then on line five, we'll change query ...

Using real_query()
Video duration: 6m 1s 3h 47m Intermediate

Viewers:

Using real_query() provides you with in-depth training on Developer. Taught by David Powers as part of the Accessing Databases with Object-Oriented PHP

Subject:
Developer
Software:
PHP
Author:
please wait ...