For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > July 2005 > DB_DataObject multiple deletes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DB_DataObject multiple deletes
Etienne van Tonder

2005-07-27, 4:02 am

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.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com