Jump to content

jon_tries_php

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by jon_tries_php

  1. I am attempting to get moodle a php based open source app to work with firebird and am failing miserably. My current problem is my dataset is missing fieldnames. It simply uses numbers to identify the columns. I ran it using mysql and with a print_r dump of the resultset, I can see the names have been retrieved. What is the expected behavior of a returning dataset when running a query? Do I need to start tweaking the adodb drivers to make this work? If anybody can point me to the path of enlightenment, it would greatly appreciated. Jon
  2. based on the adodb.inc.php its @version V5.04a 25 Mar 2008 when I tried fetch I got this Call to undefined method ADODB_firebird::Fetch() I tried this instead if (!$rs1->_fetch()) { error_log('Fetch failed '); } return (int)$rs1->fields[0]; which again was not returning a value. Adodb-ibase.inc.php._fetch had the following code if ($this->fetchMode == ADODB_FETCH_ASSOC) { $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); } The call to GetRowAssoc would cause the field to lose its value. Seeing as these are fairly low level functions I would assume that I should not be tweaking this things. However commenting out the GetRowAssoc call allowed me to access the field values. Does anyone know what is going on here?
  3. I am completely new to PHP and am attempting to make moodle work with Firebird. I'm not getting very far. Anyway, I need to return the primary key from an insert statement. the code goes something like this $sql = "INSERT INTO {$this->prefix}$table ($fields) VALUES($qms)"; $this->writes++; // what does this do? if (!$rs = $this->adodb->Execute($sql, $params)) { $this->report_error($sql, $params); return false; } this works fine, except I need to know what is the generated primary key, so I tried the this $sql = 'SELECT max(id) from '.$this->prefix.$table; if (!$rs1 = $this->adodb->Execute($sql)) { $this->report_error($sql); } error_log('JLJ fieldcount '.$rs1->FieldCount) ; error_log('JLJ fieldvalue '.$rs1->fields[0]) ; My problem is FieldCount and fields[0] is showing up as blank. I assume the query executed as rs1 is assigned. Is my query returning nothing because the insert is not committed? Is there another way to retrieve the generated primary key? Am I doing this completely wrong? Any pointers or help would be greatly appreciated. Jon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.