Skip to content

Commit

Permalink
Fix for return id for insert_record - needs to be cast to an int
Browse files Browse the repository at this point in the history
  • Loading branch information
mjollnir_ committed Apr 3, 2005
1 parent 2e9ddb9 commit b0debb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/datalib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
if ( !isset($dataobject->{$primarykey}) if ( !isset($dataobject->{$primarykey})
&& $CFG->dbtype === 'postgres7' && $CFG->dbtype === 'postgres7'
&& $returnid == true ) { && $returnid == true ) {
if ($nextval = get_field_sql("SELECT NEXTVAL('{$CFG->prefix}{$table}_{$primarykey}_seq')")) { if ($nextval = (int)get_field_sql("SELECT NEXTVAL('{$CFG->prefix}{$table}_{$primarykey}_seq')")) {
$dataobject->{$primarykey} = $nextval; $dataobject->{$primarykey} = $nextval;
} }
} }
Expand Down

0 comments on commit b0debb8

Please sign in to comment.