- To: pgsql-php@xxxxxxxxxxxxxx
- Subject: [newbie] How to do "batch insert"?
- From: =?gb18030?q?=C0=EE=D1=E5_Ian_Li?= <liyan82@xxxxxxxxx>
- Date: Fri, 08 Jun 2007 16:44:10 +0800
- User-agent: Mozilla-Thunderbird 2.0.0.0 (X11/20070601)
Hi all.
In the scene I want to insert all elements of an array in to a
table, how can I do to commit them as a whole?
currently I do like this:
<?php
$result = pg_prepare($dbconn, "ins_acl", 'INSERT INTO
acls(oid,uid,gid,mod) VALUES($1,$2,$3,$4)');
for($i=0;$i<count($p["acls"]);$i++){
pg_execute($dbconn, "ins_lgs",$p["acls"][i]);
}
?>
I wonder while doing so, will it commit in each LOOP or just ONCE?
Thanks and Regards,
Ian
[Postgresql General]
[Postgresql Admin]
[PHP Users]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[PHP Databases]
[Yosemite Backpacking]
[Postgresql Jobs]