Re: MDB2 autoexecute taking only relevant fields ?
| From: | Lorenzo Alberton | Date: | Fri, 15 Dec 2006 16:30:21 +0000 |
| Subject: | Re: MDB2 autoexecute taking only relevant fields ? | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26110@lists.php.net to get a copy of this message | ||
Pierre-Yves Stucki wrote:
I couldn't find better words ;-)Aren't you lucky that you have to clean the raw $_POST array! You do realise that what you are trying to do is paramount to suicide right?
Yes I do, that's why in fact I never deal directly with $_POST. I simplified the example for my question, but as I wrote in my previous mail, data go through exportValues first and I have a set of rules and filters to clean them.what you want to achieve requires some extra queries so it's unlikely that it will be supported internally by MDB2, but you can easily add another check in your filter: ====================================================== $db->loadModule('Manager', null, true); $fields = $db->manager->listTableFields($this->table); foreach (array_keys($myValues) as $field) {
if (!in_array($field, $fields)) {
unset($fields[$field]);
}
}
======================================================
HTH
Best regards,
--
Lorenzo Alberton
http://pear.php.net/user/quipo
___________________________________________________________________
Quipo Free Internet - 2 email, 150 Mb di spazio web e molto di più.
ADSL, Hardware & Software Online Store