Re: Fwd: Dataobjects find

From: Date: Thu, 24 Apr 2003 15:58:16 +0000
Subject: Re: Fwd: Dataobjects find
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5031@lists.php.net to get a copy of this message
of course how stupied of me, I just did't think of that, yhx a lot ,p On Thursday, Apr 24, 2003, at 17:34 Europe/Stockholm, PJ Taylor wrote:
Patrik, I'm not part of the development team for DB_DataObjects or anything, but I do use them quite a lot (thanks to the team, by the way, they're great!!) I think your problem is that you're using the same object. I had some trouble like this and found that a new instance of the dataobject made the new action work. So if you just add:
if (isset($_POST[submit_new])) { $cat->name = $_POST[new_category_name]; $cat->insert(); }
$cat = new DataObjects_cat; //if you need it to only get rows with that name $cat->name = $_POST[new_category_name];
$number_of_rows = $cat->find(); while ($cat->fetch()) { $cat_array[$cat->id] = array('name' => $cat->name, 'id' => $cat->id); }
That should work, I think. HTH PJ _________________________________________________________________ Express yourself with cool emoticons http://www.msn.co.uk/messenger


« previous php.pear.general (#5031) next »