Databases Reference
In-Depth Information
" AND username='{$_SESSION['username']}'";
// Run the query through the connection
if (($result = @ mysqli_query($connection, $query))==FALSE)
showerror($connection);
// Create a message to show the user
if (mysqli_affected_rows($connection) == 1)
$message = "Removed the gift from your shopping list, ".
"{$_SESSION['username']}";
else
$message = "Couldn't unreserve the gift - perhaps you hadn't reserved it?";
Resources
There are many excellent resources available for you to learn more about PHP, its
libraries, web servers, and building web database applications. We have listed several
of these resources at the end of the previous two chapters. You might find the following
additional resources helpful:
•
Web Database Applications with PHP and MySQL
by Hugh E. Williams and David
Lane (O'Reilly)
•
A Programmer's Introduction to PHP 4.0
by W. Jason Gilmore (Apress)
•
PHP Black Book
by Peter Moulding (The Coriolis Group)
•
PHP Functions Essential Reference
by Zak Greant et al. (Sams)
•
PHP and MySQL Web Development
by Luke Welling and Laura Thomson (Sams)
•
Professional PHP4 Programming
by Deepak Thomas et al. (Wrox Press)
•
PHP Developer's Cookbook
by Sterling Hughes and Andrei Zmievski (Sams)
There are also many useful web sites that include tutorials, sample code, online dis-
cussion forums, and links to sample PHP applications. The official PHP site has an
excellent manual at
http://www.php.net/manual
, and the links page at
http://www.php
.net/links.php
points to many of these sites, including:
Exercises
1. How can you refer to a PHP script file from within itself?
2. Would you use the
urlencode( )
function with data submitted through the POST
method?