Last active
December 17, 2015 00:29
-
-
Save colindecarlo/5521017 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $conn = mysql_connect("localhost", "twa312", "dam6av9a"); | |
| mysql_select_db("warehouse312", $conn) | |
| or die ('Database not found ' . mysql_error() ); | |
| $sql = "select customerID, lastName from customer"; | |
| $rs = mysql_query($sql, $conn) | |
| or die ('Problem with query' . mysql_error()); | |
| $options = '<option value="0">Choose</option>'; | |
| while ($row = mysql_fetch_array($rs)) { | |
| $id = $row["customerID"]; | |
| $name = $row["lastName"]; | |
| $options .= '<option value="'. $id . '">' . $name .'</option>'; | |
| } | |
| ?> | |
| <form method="GET" action="task8.php" id="custinfo" > | |
| Choose name: | |
| <select name="lname" id="lname"> | |
| <?php echo $options; ?> | |
| </select> | |
| <p><input type="submit" name="submit" value="Save Data"/> <input type="reset" value="Clear Form" /> | |
| </form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment