Re: setFrom() method in DB_DataObjects
| From: | Alan Knowles | Date: | Thu, 06 Feb 2003 08:23:22 +0000 |
| Subject: | Re: setFrom() method in DB_DataObjects | ||
| References: | 1 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-3625@lists.php.net to get a copy of this message | ||
David Dahl wrote:
What am i doing wrong with the setFrom() method? $updateAssoc = new DataObjects_Association; $updateAssoc->get($_POST[assoc_id]); //<--Primary ID $updateAssoc->setFrom($_POST['input']); <--Post VARS $updateAssoc->assoc_logo = $home_page_logo; <-- returned variable from another function $updateAssoc->assoc_picture = $home_page_photo; <-- returned variable from another function $updateAssoc->update();if you called your form objects: <input name='input[abc]'> then setFrom($_POST['input']) is relivant, otherwise, if you just called them <input name='abc'> then setFrom($_POST) is relivant. Regards Alan PS. quote your array element = it prevents warnings if you use error_reporting(E_ALL)$updateAssoc->setFrom($_POST['input']); <-- what does the 'input' mean i copied this straight from the docs, should it just be "$_POST[]" or "$_POST"?
The only data that gets updated is the $home_page_logo and $home_page_photo vars. Thanks in advance, David Dahl