Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Video Player
00:00
00:00
00:00
- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
We'll finalize our book modifications by creating the editBook procedure.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
We need to set up the edit procedure.
0:01
Let's copy our addBook.
0:04
And create a new file named editBook.
0:11
First we need to add the bookId.
0:16
Then we change the addBook
function to updateBook.
0:30
And we pass the bookId as well.
0:40
And finally we change add.php to edit.
0:43
And we need to pass the bookId.
0:49
Next we need to create the updateBook
function in the functions file.
0:57
Let's close out some of these files.
1:06
And let's start by
duplicating the addBook.
1:12
We'll change this to updateBook,
and accept the bookId.
1:24
Now we need to change the SQL statement.
1:30
UPDATE books.
1:36
SET name=:name, description=:description.
1:44
WHERE.
1:54
Id = bookId.
2:03
We'll remove the ownerId from here.
2:08
And we'll change ownerId to bookId.
2:12
Let's check this out in the browser.
2:27
Great.
2:43
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up