Guest User

Untitled

a guest
May 7th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <select name= "indication_name" id= "update_indication_id" class="form-control" required>
  2. <?php
  3. $sql = "SELECT id,description From indications";
  4. $result=mysqli_query($con,$sql);
  5. while($row=mysqli_fetch_array($result)){
  6. echo "<option selected='selected'>" . $row['id']." - ". $row['description'];
  7. }
  8.  
  9. ?>
  10. </select>
  11.  
  12. <select name= "indication_name" id= "update_indication_id" class="form-control" required>
  13. <?php
  14. $sql = "SELECT id,description From indications";
  15. $result=mysqli_query($con,$sql);
  16. while($row=mysqli_fetch_array($result))
  17. echo "<option value='" . $row['id'] . "'>" . $row['description'] . "</option>";
  18. ?>
  19. </select>
  20.  
  21. <select name= "indication_name" id= "update_indication_id" class="form-control" required>
  22. <option selected="selected" value="">-- Select an option --</option>
  23. <?php
  24. $sql = "SELECT id,description From indications";
  25. $result=mysqli_query($con,$sql);
  26. while($row=mysqli_fetch_array($result))
  27. echo "<option value='" . $row['id'] . "'>" . $row['description'] . "</option>";
  28. ?>
  29. </select>
  30.  
  31. <?php
  32. $server="localhost";
  33. $username="root";
  34. $password="";
  35. $link=@mysql_connect($server, $username, $password) or die ("Cannot connect to mysql server: ".@mysql_error());
  36. $dbname = 'database_name';
  37. @mysql_select_db($dbname, $link) or die ("Cannot connect to database: ".@mysql_error());
  38.  
  39. $query="SELECT id,description from indications";
  40. $result = @mysql_query ($query);
  41. echo "<select name=indication_name value=' '>";
  42. while($drop=@mysql_fetch_array($result)){
  43. echo "<option value=$drop[id]>$drop[description]</option>";
  44. }
  45. echo "</select>";
  46. ?>
Add Comment
Please, Sign In to add comment