Transactions not required here either, actually

This commit is contained in:
kaetemi 2014-09-03 06:16:41 +02:00
parent 4982e7c6c4
commit c008e0b46d

View file

@ -130,14 +130,10 @@ class DBLayer {
foreach ($data as $key => $value) {
$sth->bindValue( ":$key", $value );
}
$this->PDO->beginTransaction();
$sth->execute();
$lastId = $this->PDO->lastInsertId();
$this->PDO->commit();
}
catch (Exception $e) {
// for rolling back the changes during transaction
$this->PDO->rollBack();
throw $e; // new Exception( "error in inseting" );
}
return $lastId;