In this video, you will discuss the different choices for extracting data from the result set of a query, and learn to use mysqli_fetch_assoc with a while loop to efficiently loop through the records in a result set.
- We've learned how to use PHP…to connect the MySQL database…and how to query the database…to get back a result set.…In this movie, we're going to learn…the options we have for working…with those result sets.…There are three things were going to look at;…We're going to look at mysqli_fetch_row,…mysqli_fetch_assoc, short for association.…And mysqli_fetch_array.…Mysqli_fetch_row is going to return the results back…from a results set as standard arrays.…So for example, if we had a subjects result set…that we pulled back from the database,…use mysqli_fetch_row…to get the first row of data from that.…
It would return back a standard array…that looks something like this.…The first item is '1'.…That's the ID.…The second one is the menu name,…and then the third one would be the position.…And the fourth one would be visible.…In order to access these values,…because it's a standard array,…we would just use integers.…That's how the keys are indexing it.…SO if we wanted to take a subject…and we wanted to ask for it's menu name,…
- Organizing project files
- Including and requiring files
- Working with URL parameters
- Encoding dynamic content
- Modifying headers and page redirection
- Creating forms and processing form data
- MySQL basics
- Using PHP to access database tables
- Creating, reading, updating, and deleting database records with PHP
- Validating data
- Preventing SQL injection
Skill Level Beginner
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. Start a Database-Driven Project
2. Build Web Pages with PHP
3. Headers and Redirects
4. Build Forms with PHP
5. MySQL Basics
6. Use PHP to Access MySQL
7. CRUD with PHP
8. Validate Data with PHP
9. Prevent SQL Injection
Next steps1m 8s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.