DB_DataObject multiple deletes
| From: | Etienne van Tonder | Date: | Wed, 27 Jul 2005 08:23:17 +0000 |
| Subject: | DB_DataObject multiple deletes | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20159@lists.php.net to get a copy of this message | ||
Is it possible to perform a delete in a loop using the same DO object, ie
foreach ($ridarray as $rid => $val)
{
if ($rid > 0)
{
if ($fDBTable->get($rid) > 0)
{
$fDBTable->delete();
}
}
}
This does not work because of the values in the object from the previous
get() as well I get an error in the find function as
$this->_query['data_select'] is not defined, ie
$sql = 'SELECT ' .
$this->_query['data_select'] . // **** error on this line ****
' FROM ' . ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) :
$this->__table) . " " .
$this->_join .
$this->_query['condition'] . ' '.
$this->_query['group_by'] . ' '.
$this->_query['having'] . ' '.
$this->_query['order_by'] . ' ';
Also, is it possible to clear all the values in an object or should I just
create a new instance?
Regards,
Etienne.