note 114103 added to mysqli.begin-transaction
| From: | aguchoca at gmail dot com | Date: | Sat, 11 Jan 2014 08:50:27 +0000 |
| Subject: | note 114103 added to mysqli.begin-transaction | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198202@lists.php.net to get a copy of this message | ||
Esto es como es usado
<?php
try {
$gbd = new PDO('odbc:SAMPLE', 'db2inst1', 'ibmdb2',
array(PDO::ATTR_PERSISTENT => true));
echo "Conectado\n";
} catch (Exception $e) {
die("No se pudo conectar: " . $e->getMessage());
}
try {
$gbd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$gbd->beginTransaction();
$gbd->exec("insert into staff (id, first, last) values (23, 'Joe',
'Bloggs')");
$gbd->exec("insert into salarychange (id, amount, changedate)
values (23, 50000, NOW())");
$gbd->commit();
} catch (Exception $e) {
$gbd->rollBack();
echo "Fallo: " . $e->getMessage();
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/mysqli.begin-transaction.php
Edit -- https://master.php.net/note/edit/114103
Del: integrated -- https://master.php.net/note/delete/114103/integrated
Del: useless -- https://master.php.net/note/delete/114103/useless
Del: bad code -- https://master.php.net/note/delete/114103/bad+code
Del: spam -- https://master.php.net/note/delete/114103/spam
Del: non-english -- https://master.php.net/note/delete/114103/non-english
Del: in docs -- https://master.php.net/note/delete/114103/in+docs
Del: other reasons-- https://master.php.net/note/delete/114103
Reject -- https://master.php.net/note/reject/114103
Search -- https://master.php.net/manage/user-notes.php