note 114103 deleted from mysqli.begin-transaction by daverandom

From: Date: Mon, 19 May 2014 08:55:31 +0000
Subject: note 114103 deleted from mysqli.begin-transaction by daverandom
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-199562@lists.php.net to get a copy of this message
Note Submitter: aguchoca at gmail dot com ---- 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(); } ?>

« previous php.notes (#199562) next »