Ghufron Asadly. Diberdayakan oleh Blogger.

postgre koneksi php

Rabu, 07 Februari 2018

<?php
$conn = pg_connect("host=localhost port=5432 dbname=dfg user='postgres'
password='ddd'");

//$result = pg_prepare($conn, "my_query", 'SELECT * FROM halamans');
//// disini saya membuat table dengan nama mahasiswa
//$result = pg_execute($conn, "my_query",array());
//while ($row = pg_fetch_assoc($result))
//{
//    print_r($row);
//}


new query pg

$pgquery ="SELECT *  FROM sdm.ms_pegawai where nik='$nik'  limit 1";
            $pgresult = pg_query($pgquery);
            $line = pg_fetch_array($pgresult, null, PGSQL_ASSOC);

Tidak ada komentar:

Posting Komentar

 

Most Reading