Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help making the delete and update function in php for these functions. On the return book the checkout_id shouldn't be in the comment above.

Need help making the delete and update function in php for these functions. On the return book the checkout_id shouldn't be in the comment above. The instructor messed up.

image text in transcribed

Here are all the tables in SQL

Patrons

image text in transcribed

Loans

image text in transcribed

Books

image text in transcribed

function checkoutBook($db, $isbn, Scard_ number) Squery = 'INSERT INTO loans (isbn, card-number, date-checked-out) sstatement $db->prepare($query) Sstatement->bindValue(':isbn', $isbn); Sstatement->bindVa lue(':card number, Scard_number); sstatement-execute); Sstatement->closeCursor); VALUES (isbn, :card-number, NOW())'; //this function deletes the row from the loans table with the given checkout id function returnBook($db, sisbn, scard_number, Sdate_checked_out) //this function updates the books table by changing the quantity for the book with the given isbn. /ote that the parameter, Sqty_increase, may be a positive or negative number function updateAvailCopies($db, sisbn, sqty_change) 73 card number first name last name email Edit ^i Copy Delete cn11223 op Edit Copy G) Delete cn12345 Edit e CopyDelete cn 13935 ep Edit Copy G) Delete cn23456 O dp Edit Copy Delete cn35738 Edit Copy G) Delete cn44775 Edit 3 Copy Delete cn78324 Op Edit Copy Delete cn7962 1 Edit 3 Copy Delete cn83987 Edit CopyDelete cn95938 o Edit Copy Delete cn98325 Malcolm Julia Mark Howard Gretchen Hil Jerome Jean Beth Charles Karen Patrick Wagner Desai Smith Gordon Wallace Griffin Woodard Little Puckett Hill wagner@email.com desai@email.com smith@email.com gordon@email.com hill3@email.com wallace @email.com griffin@email.com woodard@email.com little@email.com puckett@email.com hill2@email.com SELECT FRONloans isbn card number date checked out HT- isbn title author total _copies avail_copies genre Edit ^i Copy Delete 0061348112 The Indifferent Stars Above Daniel James Brown 4 nonfiction 4 fiction 5 fantasy 4 fantasy 6 fantasy 5 fantasy 4 fantasy 4 fantasy 3 fantasy 3 fantasy 3 fantasy 4 fantasy 4 nonfiction 3 fiction 2 nonfiction 2 biography 3 biography 5 nonfiction 2 nonfiction 2 biography 3 nonfiction 3 fiction 3 fiction 5 fiction Jojo Moyes Edit ^i Copy Delete 0439064872 Harry Potter and the Chamber of Secrets J.K. Rowling Edit Copy G) Delete 0439136369 Harry Potter and the Prisoner of Azkaban JK Rowling J.K. Rowling op Edit Copy G) Delete 0439358078 Harry Potter and the Order of the Phoenix J.K Rowling Edit ^i Copy Delete 0439765960 Harry Potter and the Half-Blood Prince J.K. Rowling Copy Delete 0545139708 Harry Potter and the Deathly Hallows J.K. Rowling Copy G) Delete 0143108867 After You 4 dp Edit Copy Delete 04391 39600 Harry Potter and the Goblet of Fire 4 Edit 3 Copy Delete 054792819x The Return of the King J.R.R. Tolkien J.R.R. Tolkien J.R.R. Tolkien J.R.R. Tolkien Daniel James Brown Jojo Moyes David McCullough David McCullough David McCullough Bryan Stevenson Bryan Stevenson David McCullough Daniel James Brown Khaled Hosseini Khaled Hosseini Khaled Hosseini Copy Delete 0547928203 The Two Towers Edit e CopyDelete 0547928211 The Fellowship of the Ring Edit CopyDelete 054792822X The Hobbit O dp Edit Copy Delete 067002581x The Boys in the Boat Edit Copy G) Delete 0670026603 Me Before You Edit ^i Copy Delete 0671244094 The Path Between the Seas GP Edit Copy G) Delete 0671869205 Truman Edit 3 Copy Delete 0743223133 John Adams op Edit O dp Edit GP Edit O dp Edit op Edit Copy G) Delete 0812994520 Just Mercy Copy Copy G) Delete 1476728742 The Wright Brothers Copy Delete 1468587382 Five Kids and One Gun Delete 1493022008 Under a Flaming Sky Copy G)) Delete 1594489505 A Thousand Splendid Suns Edit ^i Copy Delete 159463193X Kite Runner Edit . Copy G) Delete 1594632383 And the Mountains Echoed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

50 Tips And Tricks For MongoDB Developers Get The Most Out Of Your Database

Authors: Kristina Chodorow

1st Edition

1449304613, 978-1449304614

More Books

Students also viewed these Databases questions

Question

What is the purpose of collision insurance coverage?

Answered: 1 week ago

Question

Compare Gardners and Sternbergs theories of intelligence.

Answered: 1 week ago

Question

Can workers be trained in ethics? How? Defend your answer.

Answered: 1 week ago