PHP and Databases due Mon 05 Feb 11:00

In completing this assignment you will:
...toward writing a working book-listing application.


At the end of this assignment your book selling application should have the following pages:
A self-posting sellers form that accepts an ISBN, the condition of the book, the asking price of the book, and a comment from the seller. Form elements are validated as in the previous assignment. Now, however, you will be first looking for the ISBN in the local database. If not present you will consult the API for the purpose of getting the book data into the local database. If the book data is available from any source then you will add the book data together with the form data into the database (assuming the user has an id of 1). If book is not found anywhere then it is considered to be an invalid isbn and the form is presented again. Any data you put into the database needs to be sanitized to avoid SQL-injection attacks. If the listing is saved to the database the user should be given a confirmation message.

In the lab day assignment you wrote code that inserts a book into the book table if needed. That happens when you are validating the ISBN. For this portion of the assignment you will be inserting a new listing (in the listing table) as follows:

INSERT INTO yourschema.listing (owner_id,isbn,price,condition,seller_notes) VALUES ($1,$2,$3,$4,$5)

A display page that shows isbn, book title, authors, condition, price, and seller notes. These should be place in a table element so as to line up nicely on the screen. Use SELECT * FROM yourschema.listings to extract the data.

Quick Links