4 <?php include "_skipif.inc"; ?>
11 $c = new pq\Connection(PQ_DSN);
12 $c->exec("DROP TABLE IF EXISTS test");
13 new pq\Event($c, pq\Event::NOTICE, function($c, $notice) {
14 echo "Got notice: $notice\n";
16 $t = new pq\Transaction($c);
17 $c->exec("DROP TABLE IF EXISTS test");
18 $c->exec("CREATE TABLE test (id serial, data text)");
19 $s = $c->prepare("test_insert", "INSERT INTO test (data) VALUES (\$1)", array((new pq\Types($c))["text"]->oid));
23 $r = $c->exec("SELECT * FROM test");
24 while ($row = $r->fetchRow(pq\Result::FETCH_OBJECT)) {
25 printf("%d => %s\n", $row->id, $row->data);
32 Got notice: NOTICE: table "test" does not exist, skipping
33 Got notice: NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for serial column "test.id"