Lines Matching refs:db
16 $db = pg_connect($conn_str);
17 pg_query($db, "CREATE TABLE {$table_name} (num int, str text, bin bytea)");
18 pg_query($db, "INSERT INTO {$table_name} (num) VALUES(1000)");
20 $db_socket = pg_socket($db);
23 $nb_send = pg_send_prepare($db, 'php_test', "SELECT * FROM ".$table_name." WHERE num > \$1;");
27 nb_flush($db, $db_socket);
30 nb_consume($db, $db_socket);
32 if (!($result = pg_get_result($db))) {
37 $nb_send = pg_send_execute($db, 'php_test', array(100));
41 nb_flush($db, $db_socket);
44 nb_consume($db, $db_socket);
46 if (!($result = pg_get_result($db))) {
66 pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
67 pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
75 $nb_send = pg_send_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);");
79 nb_flush($db, $db_socket);
82 nb_consume($db, $db_socket);
84 if (!($result = pg_get_result($db))) {
89 $nb_send = pg_send_execute($db, "php_test2", array(9999, "A'BC"));
93 nb_flush($db, $db_socket);
96 nb_consume($db, $db_socket);
98 if (!($result = pg_get_result($db))) {
104 pg_close($db);
113 $db = pg_connect($conn_str);
114 pg_query($db, "DROP TABLE IF EXISTS {$table_name}");