From 3ddf42f0ef98b5e864354ded8888a0f7984b131f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 3 Sep 2014 05:11:11 +0200 Subject: [PATCH] Fix #180 --- code/web/private_php/ams/autoload/dblayer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/web/private_php/ams/autoload/dblayer.php b/code/web/private_php/ams/autoload/dblayer.php index c6f643ac7..589a88e57 100644 --- a/code/web/private_php/ams/autoload/dblayer.php +++ b/code/web/private_php/ams/autoload/dblayer.php @@ -121,10 +121,10 @@ class DBLayer { * @param $data the parameters that are being inserted into table. * @return returns the id of the last inserted element. */ - public function executeReturnId( $tb_name, $data ) { + public function executeReturnId( $tb_name, $data, $datafunc = array() ) { $this->useDb(); - $field_values = ':' . implode( ',:', array_keys( $data ) ); - $field_options = implode( ',', array_keys( $data ) ); + $field_options = implode(',', array_merge(array_keys($data), array_keys($datafunc))); + $field_values = implode(',', array_merge(array(':' . implode(',:', array_keys($data))), array_values($datafunc))); try { $sth = $this -> PDO -> prepare( "INSERT INTO $tb_name ($field_options) VALUE ($field_values)" ); foreach ( $data as $key => $value )