note 103659 modified in function.pg-query by danbrown
| From: | danbrown@php.net | Date: | Tue, 26 Apr 2011 18:51:27 +0000 |
| Subject: | note 103659 modified in function.pg-query by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179174@lists.php.net to get a copy of this message | ||
Transactions can be accomplished using the following syntax:
<?php
pg_query($db, "BEGIN WORK");
// Some insert/update/delete queries.
$res=pg_query($db, "INSERT INTO customers (customer_id) VALUES
('$customer_id')");
// Verify and end the transaction as appropriate.
if (!$res) {
pg_query($db, "ROLLBACK");
} else {
pg_query($db, "COMMIT");
}
?>
--was--
Transactions can be accomplished using the following syntax:
pg_query($db, "BEGIN WORK");
// Some insert/update/delete queries.
$res=pg_query($db, "INSERT INTO customers (customer_id) VALUES
('$customer_id')");
// Verify and end the transaction as appropriate.
if (!$res) {
pg_query($db, "ROLLBACK");
} else {
pg_query($db, "COMMIT");
}
http://php.net/manual/en/function.pg-query.php