I've had the same problem. I tried to debug it by myself and I found out,
that the SQL which is produced by the adapter has some questionmarks instead
of the right values.
I've changed a line in an else-block and it seems to work now.
In the Zend_Db_Adapter_Abstract I wrote the following:
foreach ($bind as $col => $val) {
$cols[] = $this->quoteIdentifier($col, true); if ($val instanceof
Zend_Db_Expr) {
$vals[] = $val->toString(); unset($bind[$col]);
} else {
#$vals[] = '?';
$vals[] = $this -> quoteInto('?', $val);
}
}
The whole part can be found from line 340 to 348 in the
Zend/Db/Adapter/Abstract.php (version 1.0.1).
I'm not shure if it was right to change this line, but it seems to work
well.
Justin Hendrickson-2 wrote:
>
> I'm still looking for some help with this problem. I've experience the
> problem with both 1.0.0 and 1.0.1.
>
> If it is indeed a bug within PHP, does anyone have any resources on
> how I to do internal stack trace dumps for submitting the bug?
>
> On 8/1/07, Justin Hendrickson <[EMAIL PROTECTED]> wrote:
>> I'm trying to create a row and save it, but I keep getting this error
>> message:
>> 'Cannot refresh row as parent is missing'
>>
>> I tracked the problem down to Zend_Db_Table_Row_Abstract, line 371:
>> $primaryKey = $this->_getTable()->insert($this->_data);
>>
>> var_dump($primaryKey) shows it's null.
>>
>> Backtracking to insert() in Zend_Db_Table_Abstract, line 788:
>> return $this->_db->lastInsertId();
>>
>> I changed this to:
>> $id = $this->_db->lastInsertId();
>> var_dump($id);
>> return $id;
>>
>> This displayed '273', the next auto increment value for the database.
>>
>> For some reason, the value is correctly coming back from the
>> Zend_Db_Adapter, but something is breaking the return value from
>> Zend_Db_Table_Abstract::insert() to
>> Zend_Db_Table_Row_Abstract::_doInsert().
>>
>> I tested with PHP 5.2.1/Ubuntu 7.04 and PHP 5.2.3/Windows Server 2003
>> SP2.
>>
>> Has anyone else encountered this problem? Can anyone share any insight?
>>
>
>
--
View this message in context:
http://www.nabble.com/PHP-bug-when-calling-save%28%29-on-a-newly-created-Zend_Db_Table_Row-tf4201341s16154.html#a12092492
Sent from the Zend Framework mailing list archive at Nabble.com.