Learn how to define an update method that will automatically convert an object's properties into an SQL UPDATE statement; send an admin's values to the update method using a web form; and write a save method that can both create or update an object based
- [Instructor] In this movie, we're going to finish learning…to update a record, using object oriented programming…and our active record design pattern.…So far, we've completed the first part…of the update process,…which is that we've retrieved a row of data…from the database, and turned it into an object,…so that we can present it as a form for the user,…so the user can edit its properties.…Now we need to do the second part,…which is we need to take the values…that the user submits,…and we need to update a row in the database, using SQL.…
So here's the form that we created in the last movie,…what we want now is when we click Edit Bicycle,…and it submits a post_request,…we want it to update the values in the database.…So let's go to our code on edit.php,…and you can see down here we took care of…when we have a get request, that's the else down here,…up here is if it's a post_request,…if this form is being submitted.…And you can see that we're getting all of the different…values that we need from the form.…We're putting them into this associative array for args.…
Note: This is an intermediate-level training course that assumes you have existing knowledge of PHP. To refresh your skills, check out PHP Essential Training and PHP: Object-Oriented Programming.
- Creating a project database and tables
- Connecting to the database
- Database queries with OOP
- The active record design pattern
- Defining a database-driven class
- Performing common database tasks with OOP
- Creating inheritable and reusable code
- Object-oriented user authentication
- Object-oriented pagination
Skill Level Intermediate
Consuming RESTful APIs in PHP with Guzzlewith Justin Yost2h 12m Intermediate
PHP: Accessing Databases with PDO and MySQLiwith David Powers3h 47m Intermediate
1. Overview and Project Setup
2. The Database Connection
3. Define a Database-Driven Class
4. Object-Oriented CRUD
5. Object-Oriented Authentication
6. Object-Oriented Pagination
- 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.