21pg_get_notify.phpt 356 B

1234567891011121314151617181920
  1. --TEST--
  2. PostgreSQL pg_get_notify() functions
  3. --SKIPIF--
  4. <?php include("skipif.inc"); ?>
  5. --FILE--
  6. <?php
  7. // optional functions
  8. include('config.inc');
  9. $db = pg_connect($conn_str);
  10. pg_query($db, 'LISTEN test_msg');
  11. pg_query($db, 'NOTIFY test_msg');
  12. $msg = pg_get_notify($db);
  13. isset($msg['message'],$msg['pid']) ? print 'OK' : print 'NG';
  14. ?>
  15. --EXPECT--
  16. OK