Re: How to know the ID of the new element inserted with DBDOFB
| From: | Justin Patrin | Date: | Fri, 14 Jul 2006 17:13:18 +0000 |
| Subject: | Re: How to know the ID of the new element inserted with DBDOFB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24651@lists.php.net to get a copy of this message | ||
On 7/14/06, Jose Manuel Zea <jmzeag@yahoo.es> wrote:
Hi: This is the code I wrote to get the form ($this->do is a DB_DataObject). $builder =& DB_DataObject_FormBuilder::create($this->do); $form = $builder->getForm($_SERVER['REQUEST_URI']); if ($form->validate()) {DB_DO puts it into the DO. Just access that field and you have it. $do->insert(); echo $do->id; -- Justin Patrin$res = $form->process(array($builder,'processForm'), false);$validate = $res; if (!$validate){ $errores = $form->getValidationErrors(); }} How can I know the ID of the new element inserted in for a new element after the form is validated and processed?