Re: Fwd: Dataobjects find
| From: | PJ Taylor | Date: | Thu, 24 Apr 2003 15:34:16 +0000 |
| Subject: | Re: Fwd: Dataobjects find | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5030@lists.php.net to get a copy of this message | ||
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:
$cat = new DataObjects_cat; //if you need it to only get rows with that name $cat->name = $_POST[new_category_name];if (isset($_POST[submit_new])) { $cat->name = $_POST[new_category_name]; $cat->insert(); }
That should work, I think. HTH PJ _________________________________________________________________ Express yourself with cool emoticons http://www.msn.co.uk/messenger$number_of_rows = $cat->find(); while ($cat->fetch()) { $cat_array[$cat->id] = array('name' => $cat->name, 'id' => $cat->id); }