Fwd: Dataobjects find

From: Date: Thu, 24 Apr 2003 13:38:50 +0000
Subject: Fwd: Dataobjects find
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5028@lists.php.net to get a copy of this message
Begin forwarded message:
From: Patrik Berggren <patrik.berggren@jcd.com> Date: Thu Apr 24, 2003 15:37:59 Europe/Stockholm To: pear-general@lists.php.net Subject: Dataobjects find im doing a insert like: if (isset($_POST[submit_new])) { $cat->name = $_POST[new_category_name]; $cat->insert(); } and then I do a fetch $number_of_rows = $cat->find(); while ($cat->fetch()) { $cat_array[$cat->id] = array('name' => $cat->name, 'id' => $cat->id); } but if the if is true so it does an insert then the result of the fetch is only the row that was inserted, but if the if is flase then I get all the row in the db, and I would like to get all the rows even if the insert is done, but I don't know how, plz help .patrik


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