Lines Matching refs:conn

12 $conn = pg_connect($conn_str);
14 pg_query($conn, 'CREATE SCHEMA phptests');
16 pg_query($conn, 'CREATE TABLE foo (id INT, id2 INT)');
17 pg_query($conn, 'CREATE TABLE phptests.foo (id INT, id2 INT)');
19 pg_insert($conn, 'foo', array('id' => 1, 'id2' => 1));
20 pg_insert($conn, 'foo', array('id' => 1, 'id2' => 2));
21 pg_insert($conn, 'foo', array('id' => 1, 'id2' => 2));
22 pg_insert($conn, 'foo', array('id' => 3, 'id2' => 3));
24 pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 1));
25 pg_insert($conn, 'phptests.foo', array('id' => 1, 'id2' => 2));
26 pg_insert($conn, 'phptests.foo', array('id' => 2, 'id2' => 3));
27 pg_insert($conn, 'phptests.foo', array('id' => 2, 'id2' => 3));
29 pg_delete($conn, 'foo', array('id' => 1, 'id2' => 0));
30 pg_delete($conn, 'foo', array('id' => 1, 'id2' => 2));
31 var_dump(pg_delete($conn, 'foo', array('id' => 1, 'id2' => 2), PGSQL_DML_STRING));
33 pg_delete($conn, 'phptests.foo', array('id' => 2, 'id2' => 1));
34 pg_delete($conn, 'phptests.foo', array('id' => 2, 'id2' => 3));
35 var_dump(pg_delete($conn, 'phptests.foo', array('id' => 2, 'id2' => 3), PGSQL_DML_STRING));
37 var_dump(pg_fetch_all(pg_query($conn, 'SELECT * FROM foo')));
38 var_dump(pg_fetch_all(pg_query($conn, 'SELECT * FROM phptests.foo')));
41 pg_delete($conn, 'bar', array('id' => 1, 'id2' => 2));
42 var_dump(pg_delete($conn, 'bar', array('id' => 1, 'id2' => 2), PGSQL_DML_STRING));
44 pg_query($conn, 'DROP TABLE foo');
45 pg_query($conn, 'DROP TABLE phptests.foo');
46 pg_query($conn, 'DROP SCHEMA phptests');