Let's Get Started with an Advanced PHP/MySQL Form Page!
Open Notepad++
Choose: File -> new
Copy the PHP Form Template (PHP) code (below)
Paste that code into your new file
After the // Create the SELECT query line add: $query = "SELECT dish_id, dish_name, price, is_spicy ";
$query .= "FROM dishes ";
$query .= "WHERE dish_id = $id;";
After the // Create the DELETE query line add: $query = "DELETE ";
$query .= "FROM dishes ";
$query .= "WHERE dish_id = $id;";
After the // Create the INSERT query line add: $query = "INSERT INTO dishes (dish_name, price, is_spicy) ";
$query .= "VALUES ('$name', $price, $isSpicy);";
After the // Create the UPDATE query line add: $query = "UPDATE dishes ";
$query .= "SET dish_name = '$name', price = $price, is_spicy = $isSpicy ";
$query .= "WHERE dish_id = $id;";
Add the value="<?php echo($name); ?>" and value="<?php echo($price); ?>" code to the appropriate <input> tags
In each <option> add the appropriate <?php if ($isSpicy == 0) { echo(" selected"); } ?> code
Click: File -> Save As
Name your file: /public_html/mysqlform2.php
Change the Save as type: to: PHP Hypertext Preprocessor (*.php)