(PHP 4 >= 4.2.0, PHP 5, PHP 7)
pg_send_query — �����첽��ѯ
$connection
, string $query
) : bool$query
) : bool
pg_send_query() �� connection
���ӷ����첽��ѯ���� pg_query() ��ͬ���������� PostgreSQL
���Ͷ����ѯ���� pg_get_result()
���εõ��������ִ�в�ѯʱ�ű���ִ�в��ᱻ��������
pg_connection_busy() ��������������Ƿ�Ϊæ������ѯ����ִ���У�������
pg_cancel_query() ���п���ȡ����ѯ��
�����û�����һ�η��Ͷ����ѯ�����û�����ͨ����æ�����ӷ��Ͷ����ѯ���������æ�����ӷ����˲�ѯ�����ȴ���һ����ѯ�������������н����
Example #1 �첽��ѯ
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
if (!pg_connection_busy($dbconn)) {
pg_send_query($dbconn,"select * from authors; select count(*) from authors;");
}
$res1 = pg_get_result($dbconn);
echo "First call to pg_get_result(): $res1\n";
$rows1 = pg_num_rows($res1);
echo "$res1 has $rows1 records\n\n";
$res2 = pg_get_result($dbconn);
echo "second call to pg_get_result(): $res2\n";
$rows2 = pg_num_rows($res2);
echo "$res2 has $rows2 records\n";
?>
����������£�
first call to pg_get_result(): Resource id #3 Resource id #3 has 3 records second call to pg_get_result(): Resource id #4 Resource id #4 has 1 records
�μ� pg_query()��pg_cancel_query()��pg_get_result() �� pg_connection_busy()��