Advertisement
Guest User

Untitled

a guest
Jul 11th, 2013
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1.  
  2.  
  3. <?php
  4. error_reporting(E_ALL);
  5. ini_set('display_errors', '1');
  6.  
  7. include_once "config.php";
  8. $pat_id       = (int) $_GET['pat_id'];
  9. //let's build the dropdown query
  10. $dd_loc_query = "SELECT * from `offices`";
  11. $dd_loc_result = mysql_query($dd_loc_query) or die(mysql_error());
  12.  
  13. $result = mysql_query("SELECT * FROM patients WHERE pat_id = $pat_id") or die(mysql_error());
  14. $row = mysql_fetch_array($result);
  15.  
  16. ?>
  17.  
  18. <form action="" method="post">
  19. <input type="hidden" name="pat_id" value="<?= $pat_id; ?>">
  20. <div><label for="Patient_name"><h2>Editing Patient<h2></label></div>
  21. <div><label for="Patient_name">Patient First Name: </label><input type="text" value="<?= $row['pat_fname'] ?>" name="pat_fname"/></div>
  22. <div><label for="Patient_name">Patient Last Name: </label><input value="<?= $row['pat_lname'] ?>" type="text" name="pat_lname"/></div>
  23. <div><label for="Patient_name">Office location: </label>
  24. <select name="pat_loc">
  25. <?php
  26.     while ($dd_loc_row = mysql_fetch_array($dd_loc_result)) {
  27.         echo "<option value=\"" . $dd_loc_row['office_id'] . "\">" . $dd_loc_row["office_name"] . "</option>";
  28.     }
  29. ?>
  30. </select>
  31. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement