]> git.mjollnir.org Git - moodle.git/commitdiff
My php 4.3.4/postgres7.4 combination was thinking
authorpaca70 <paca70>
Fri, 30 Jan 2004 07:45:36 +0000 (07:45 +0000)
committerpaca70 <paca70>
Fri, 30 Jan 2004 07:45:36 +0000 (07:45 +0000)
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.

lib/datalib.php

index ac9d891dbd2cafd14afac9a752272473b567a038..3ed9d80c3a9a9f0f64f3895f6bcc79b19eb4454d 100644 (file)
@@ -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;