Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <table>
  2. <tr><td><font COLOR=#000000 STYLE = "background-color: 669900" FACE="Arial" SIZE=3> Vali loom: </font></td><td>
  3.  
  4. <select name = "animal" id = "animal" >
  5.  
  6. <?php
  7.  
  8. $dbconn = pg_pconnect("host=localhost port=5432 dbname=jahitellimuste_db user=postgres password=zuljen");  
  9.  
  10. $result = pg_query($dbconn, "SELECT loom_id, nimetus FROM loom"); //        //echo "<option value = '".$row['loom_id']."'>".$row['nimetus']."</option>\n"; 
  11.  
  12.   while($row = pg_fetch_assoc($result))  {
  13.     $id = $row['loom_id'];             
  14.     $nimetus = $row['nimetus'];
  15.     echo "<option value = \"${id}\" >${nimetus}</option>\n";
  16.   }          
  17.  
  18.   pg_close($dbconn);
  19.  
  20.  ?>
  21.   </select>
  22.   </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement