Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. <!-- Form Name -->
  2. <legend>Prompt21 Form</legend>
  3.  
  4. <!-- Text input-->
  5.  
  6.  
  7. <!-- Text input-->
  8. <div class="form-group">
  9. <label class="col-md-4 control-label" for="story">level2</label>
  10. <div >
  11. <select name="dbname" id="dbname" >
  12. <option value="">-------------- --</option>
  13. </select>
  14. </div>
  15. </div>
  16.  
  17. <!-- Textarea -->
  18. <div class="form-group">
  19.  
  20.  
  21.  
  22. <label class="col-md-4 control-label" for="story">level2</label>
  23. <div >
  24.  
  25. <select name="dbname" id="dbname" >
  26. <option value="">-------------- --</option>
  27. </select>
  28. </div>
  29. </div>
  30.  
  31. <!-- Button (Double) -->
  32. <div class="form-group">
  33. <label class="col-md-4 control-label" for="cancel"></label>
  34. <div class="col-md-6">
  35. <button type="button" id="cancel" class="btn btn-default cancel">Cancel</button>
  36. <button type="submit" id="save" class="btn btn-success submit">OK</button>
  37. </div>
  38. </div>
  39.  
  40. </fieldset>
  41. </form>
  42. </div>
  43. </div>
  44. </div>
  45.  
  46. <?php
  47. $host = "localhost";
  48. $user = "postgres";
  49. $pass = "admin";
  50. $db = "Querybuilderdb";
  51.  
  52. $con = pg_connect("host=$host dbname=$db user=$user password=$pass")
  53. or die ("Could not connect to servern");
  54.  
  55.  
  56. $query = "select distinct levelone as Name from tab limit 1";
  57.  
  58. while($array[] = $query->pg_fetch_object());
  59.  
  60. array_pop($array);
  61.  
  62.  
  63. print_r($array);
  64. ?>
  65.  
  66. <select name="dbname" id="dbname" >
  67. <?php foreach($array as $option) : ?>
  68. <option value="<?php echo $option['Name']; ?>"><?php echo $option['name']; ?>-------------- --</option>
  69. <?php endforeach; ?> </select>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement