I thought metastorage was supposed to set it to NULL when generating
the SQL automatically?
The debug output shows it as being a '?' in the prepared query, but
nothing in the finaly query.
Does this mean I have to check for empty values on every single
assignment in metastorage???
Anyhow, I've tried this as follows, and it still doesn't work (still
produces the same debug output):
$grams = $form->GetInputValue("item_".$id."_grams");
if ( IsSet($grams) )
$inventory_item->grams = $form->GetInputValue("item_".
$id."_grams");
if ( ! $inventory_item->save() )
{
exit_error("Failed to save data for inventory item '".
$inventory_item->id."'");
}
On 19/09/2008, at 2:35 PM, Manuel Lemos wrote:
> Hello,
>
> on 09/19/2008 01:33 AM Nik Sands said the following:
> > it is optional:
> >
> > ...
> > <variable>
> > <name>grams</name>
> > <type>integer</type>
> > <optional>1</optional>
> > </variable>
> > ...
> >
> > It is being assigned immediately before the save() as follows:
> >
> > $inventory_item->grams = $form->GetInputValue("item_".$id."_grams");
> >
> > In this case, it is being assigned an empty value.
>
> That is the problem. If it is empty, don't assign it or set it to
> null .
>
> --
>
> Regards,
> Manuel Lemos
>
> Find and post PHP jobs
> http://www.phpclasses.org/jobs/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
>
========================================================
NIK SANDS - Systems Administrator, IT Services, University of
Tasmania, Australia
Phone: +61-3-63243732 (BH)
AIM / iChat: brassnix
========================================================
NIXANZ - http://nixanz.com/
Like to help out as a beta tester? Let me know which application
you'd like to test.
[Non-text portions of this message have been removed]