Lines Matching refs:db
11 $db = pg_connect($conn_str);
13 pg_query($db, "CREATE TABLE copystdin(id int, val text)");
14 pg_query($db, "COPY copystdin(id, val) FROM STDIN");
16 var_dump(pg_put_copy_data($db, "0\tFooBar\n"));
17 var_dump(pg_put_copy_data($db, "1\tBarFoo\n"));
18 var_dump(pg_put_copy_data($db, ""));
19 var_dump(pg_put_copy_end($db));
21 var_dump(pg_get_result($db));
23 var_dump(pg_fetch_all(pg_query($db, "SELECT * FROM copystdin ORDER BY id")));
24 var_dump(pg_put_copy_data($db, "Error\t1"));
25 var_dump(pg_put_copy_end($db));
26 var_dump(pg_last_error($db));
28 pg_query($db, "COPY copystdin(id, val) FROM STDIN");
29 var_dump(pg_put_copy_data($db, "Error\t1"));
30 var_dump(pg_put_copy_end($db));
32 var_dump(pg_get_result($db));
34 var_dump(pg_fetch_all(pg_query($db, "SELECT * FROM copystdin ORDER BY id")));
40 $db = pg_connect($conn_str);
41 pg_query($db, "DROP TABLE IF EXISTS copystdin");