Object Oriented PHP: How to Submit Multiple Queries


show more Submitting multiple queries 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 ...

Submitting multiple queries

In my SQL improve, the query and run query methods handle only single queries. If you want to submit multiple queries in a single operation you need to use the multiquery method. This is mysqli_multi.php which you can find in the chapter seven 07_04 folder of the exercise files. We use this to execute three select queries in succession and then loop through the results. To avoid a lot of repetitive typing, I'm going to paste in the code from query.txt, which you can find in the exercise files for this video.

The new code needs to go after the database connection. So create a new line on line four and paste in the code. Line four defines an array with the names of three car manufacturers. And the rest of the code is a select query to get the minimum and maximum price for cars for the first manufacturer in the makes array. To submit several queries in succession each query needs to be separated by a semicolon, so we need to put that semicolon just before this closing double quote here. So, insert you...

Submitting multiple queries
Video duration: 6m 41s 3h 47m Intermediate

Viewers:

Submitting multiple queries 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 ...