Permalink
Browse files

Fix for return id for insert_record - needs to be cast to an int

  • Loading branch information...
1 parent 2e9ddb9 commit b0debb89ce8990d993d42f64eabf66b2dbf1766e mjollnir_ committed Apr 3, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
View
@@ -915,7 +915,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
if ( !isset($dataobject->{$primarykey})
&& $CFG->dbtype === 'postgres7'
&& $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;
}
}

0 comments on commit b0debb8

Please sign in to comment.