SHARE
TWEET

Untitled

a guest Jan 28th, 2016 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="popup">
  2.     <form class="form-horizontal" name="combo_data" action="php/connection.php" method="POST" >
  3.         <fieldset>
  4.         <!-- Form Name -->
  5.         <legend>Prompt21 Form</legend>
  6.         <!-- Text input-->
  7.  
  8.         <!-- Text input-->
  9.         <div class="form-group">
  10.             <label class="col-md-4 control-label" for="story">level2</label>
  11.         <div >
  12.         <select name="dbname" id="dbname" >
  13.             <option value="">-------------- --</option>
  14.         </select>
  15.         </div>
  16.         </div>
  17.  
  18.         <!-- Textarea -->
  19.         <div class="form-group">
  20.           <label class="col-md-4 control-label" for="story">level2</label>
  21.         <div >
  22.  
  23.         <select name="dbname" id="dbname" >
  24.             <option value="">-------------- --</option>
  25.         </select>
  26.         </div>
  27.         </div>
  28.  
  29.         <!-- Button (Double) -->
  30.         <div class="form-group">
  31.           <label class="col-md-4 control-label" for="cancel"></label>
  32.           <div class="col-md-6">
  33.             <button type="button" id="cancel" class="btn btn-default cancel">Cancel</button>
  34.             <button type="submit" id="save" class="btn btn-success submit">OK</button>
  35.           </div>
  36.         </div>
  37.  
  38.         </fieldset>
  39.     </form>
  40.     </div>
  41.     </div>
  42. </div>
  43.    
  44. <?php
  45.     $host = "localhost";
  46.     $user = "postgres";
  47.     $pass = "admin";
  48.     $db = "Querybuilderdb";
  49.  
  50.     $con = pg_connect("host=$host dbname=$db user=$user password=$pass")
  51.         or die ("Could not connect to servern");
  52.  
  53.     $query = "select distinct levelone as Name from tab limit 1";
  54.  
  55.     while($array[] = $query->pg_fetch_object());
  56.     array_pop($array);
  57.     print_r($array);
  58. ?>
  59.  
  60. <select name="dbname" id="dbname" >
  61. <?php foreach($array as $option) : ?>
  62. <option value="<?php echo $option['Name']; ?>">
  63. <?php echo $option['name']; ?>-------------- --</option>
  64. <?php endforeach; ?> </select>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top