13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

278 Chapter 11 Accessing Your <strong>MySQL</strong> Database from the <strong>Web</strong> with <strong>PHP</strong><br />

Listing 11.3<br />

Continued<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The results of this form are passed along to insert_book.php, a script that takes the<br />

details, performs some minor validations, <strong>and</strong> attempts to write the data into the database.The<br />

code for this script is shown in Listing 11.4.<br />

Listing 11.4<br />

insert_book.php— This Script Writes New Books into the Database<br />

<br />

<br />

Book-O-Rama Book Entry Results<br />

<br />

<br />

Book-O-Rama Book Entry Results<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!