A PHP/MySQL Example with HTML Forms

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> <?php /* $Id: jokestable.php */ /** * * This program displays a table of light bulb jokes, generated from  a MySQL database. * * This file gives a solution to the following exercise: * Create a MySQL database that contains one table. The jokes table stores the light * bulb jokes. For each joke, the table stores the joke's subject (e.g., professors, * computer scientists) and the joke's punchline. Populate the table with sample data. * * This version adds two forms to the script, one to filter the jokes * by category (e.g., philosopher jokes) and the other to insert new * jokes into the database. * * Subject Punchline * * @author    R. Morelli  * @version   1.0 * @package   default * @license   http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL) * */ ?>  Light Bulb Jokes Light Bulb Jokes (Generated from Workshop Database by jokestable.php)

 Jokes Filter Form                Joke category:             ');

echo (' Input Joke Form                Subject:                 Punchline:     </LABEL>    <INPUT TYPE="Submit" VALUE="Go!" />    </FORM>');

?>