Advertisement
androidmaker155

PHP

Oct 14th, 2014
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.39 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Contoh Penggunaan PostgreSQL Extension
  4.  * @author Pusat Ilmu Secara Detil
  5.  * @version 1.0
  6.  */
  7.  
  8. pg_connect("host=localhost port=5432 dbname=mahasiswa user=posgres password=root" );
  9.  
  10. /*** Query Select ***/
  11. $query = pgsql_query("select * from mhs");
  12.  
  13. while($mhs = pgsql_fetch_array($query))
  14. {
  15.     print $mhs['nim'] .' - '. $mhs['nama'] .' - '.$mhs['alamat']. '<br />';
  16. }
  17.    
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement