From: paca70 Date: Fri, 30 Jan 2004 07:45:36 +0000 (+0000) Subject: My php 4.3.4/postgres7.4 combination was thinking X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=77e84a85f22ed5338a21ece0d2b7245a3c3a6a41;p=moodle.git My php 4.3.4/postgres7.4 combination was thinking that returned id-column was string and some modules were thingking that theres insert error if return value is string. Right now all id-colums is always integer so this should be ok. --- diff --git a/lib/datalib.php b/lib/datalib.php index ac9d891dbd..3ed9d80c3a 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -775,7 +775,7 @@ function insert_record($table, $dataobject, $returnid=true) { if ($rs = $db->Execute("SELECT id FROM $CFG->prefix$table WHERE oid = $oid")) { // every table needs to have a primary field named 'id' for this to work if ($rs->RecordCount() == 1) { - return $rs->fields[0]; + return (integer) $rs->fields[0]; // id field is integer, but this somehow needed?? } } return false;