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