Skip to content

Commit ff7f916

Browse files
author
Xenomporio
committed
Bugfix auto increment of document IDs
1 parent b618ea7 commit ff7f916

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

www/lib/class.erpapi.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33040,20 +33040,23 @@ function Firmendaten($field,$projekt='', $clearcache = false)
3304033040
if($field === 'mysql55') {
3304133041
return '1';
3304233042
}
33043-
if(strpos($field,'next') !== false)
33043+
33044+
if(strpos($field,'next') != false)
3304433045
{
3304533046
$firmendatenid = (int)$this->app->DB->Select('SELECT MAX(id) FROM firmendaten LIMIT 1');
3304633047

33047-
if ($this->app->DB->Select("SHOW COLUMNS FROM firmendaten LIKE '$field'")) {
33048-
$firmendaten_value = $this->app->DB->Select(
33049-
sprintf(
33050-
'SELECT `%s` FROM firmendaten WHERE id = %d LIMIT 1',
33051-
$field, $firmendatenid)
33052-
);
33053-
}
33048+
if ($this->app->DB->Select("SHOW COLUMNS FROM firmendaten LIKE '$field'")) {
33049+
$firmendaten_value = $this->app->DB->Select(
33050+
sprintf(
33051+
'SELECT `%s` FROM firmendaten WHERE id = %d LIMIT 1',
33052+
$field, $firmendatenid)
33053+
);
33054+
}
33055+
3305433056
if(!$this->app->DB->error()) {
3305533057
return $firmendaten_value;
3305633058
}
33059+
3305733060
$firmendaten_value = $this->app->DB->SelectRow(
3305833061
sprintf('SELECT id, wert FROM firmendaten_werte WHERE `name` = \'%s\' LIMIT 1', $field)
3305933062
);

0 commit comments

Comments
 (0)