Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="popup">
- <form class="form-horizontal" name="combo_data" action="php/connection.php" method="POST" >
- <fieldset>
- <!-- Form Name -->
- <legend>Prompt21 Form</legend>
- <!-- Text input-->
- <!-- Text input-->
- <div class="form-group">
- <label class="col-md-4 control-label" for="story">level2</label>
- <div >
- <select name="dbname" id="dbname" >
- <option value="">-------------- --</option>
- </select>
- </div>
- </div>
- <!-- Textarea -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="story">level2</label>
- <div >
- <select name="dbname" id="dbname" >
- <option value="">-------------- --</option>
- </select>
- </div>
- </div>
- <!-- Button (Double) -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="cancel"></label>
- <div class="col-md-6">
- <button type="button" id="cancel" class="btn btn-default cancel">Cancel</button>
- <button type="submit" id="save" class="btn btn-success submit">OK</button>
- </div>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
- </div>
- <?php
- $host = "localhost";
- $user = "postgres";
- $pass = "admin";
- $db = "Querybuilderdb";
- $con = pg_connect("host=$host dbname=$db user=$user password=$pass")
- or die ("Could not connect to servern");
- $query = "select distinct levelone as Name from tab limit 1";
- while($array[] = $query->pg_fetch_object());
- array_pop($array);
- print_r($array);
- ?>
- <select name="dbname" id="dbname" >
- <?php foreach($array as $option) : ?>
- <option value="<?php echo $option['Name']; ?>">
- <?php echo $option['name']; ?>-------------- --</option>
- <?php endforeach; ?> </select>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement