When I configure a column like this:
$tableColumns['mwst'] = array(
'display_text' => 'MwSt',
'perms' => 'VCXQT',
'mysql_add_fun' => "(anzahl * netto * mwstsatz / 100)",
'mysql_edit_fun' => "(anzahl * netto * mwstsatz / 100)"
);
I get the following error message:
insert into re_rechnungsdetails set `anzahl` = :anzahl, `rechnungstext` = :rechnungstext, `netto` = :netto, `mwstsatz` = :mwstsatz, `mwst` = (anzahl * netto * mwstsatz / 100)<br /><br />PDO parameter: anzahl => '1', rechnungstext => 'sdfasdfasdfasdf', netto => '20', mwstsatz => '19.0', mwst => ''
PDO Fehler:<br /> "SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens" on line: 343' in /srv/www/ensolutions.de/htdocs/r/mate/Common.php:26\nStack trace:\n#0 [internal function]: Common->logError('<br /><br />Fe...', '/srv/www/ensolu...', 1555, 'mate1_')\n#1 /srv/www/ensolutions.de/htdocs/r/mate/php/AjaxTableEditor.php(363): call_user_func(Array, '<br /><br />Fe...', '/srv/www/ensolu...', 1555, 'mate1_')\n#2 /srv/www/ensolutions.de/htdocs/r/mate/php/AjaxTa in /srv/www/ensolutions.de/htdocs/r/mate/Common.php on line 26, referer: http://ensolutions.de/r/mate/UploadToDb.php
when leaving the mysql_..._fun parameters and typing the value manually it works fine.
when I make a mysql_query("insert into re_rechnungsdetails set `anzahl` = 1, `rechnungstext` = 'test', `netto` = 100, `mwstsatz` = 19, `mwst` = (anzahl * netto * mwstsatz / 100)");
the row is added without any error.