Debugging Database Applications

One of the biggest problems when dealing with databases on the Web is trying to fix any problems that might occur when you are writing your script. You can have problems because of a bug in your script or because of an improper query.

The best way to see whether the problem lies within your script is to create a copy of the script that includes dummy variables—variables that contain information as if a visitor actually entered something into a form. Using the previous scripts, for example, you can create a set of variables that mimics information that a visitor might have entered:

$contents{ 'fname'}  = "John";
$contents{ 'lname'}  = "Doe";

After you have the dummy variables set, you can execute your script using ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.