Just add zero to the variables in your processing script...

ie...

$var_1 += 0;
$var_2 += 0;

That way if they are set to one, no difference.  if they are set to ""
then they become zero.

It's worked for me in the past.

On Thu, 24 Oct 2002, Paul Kaiser wrote:

> Hey there,
>
> I have around 50 checkboxes on an HTML form. Their "value" is "1". So,
> when a user check the box, then no problem -- the value returned by the
> form is "1" and I can enter that into my SQL database.
>
> HOWEVER...
>
> If the user does not check the box, I'm in trouble, because the "value"
> does not default to "0", but rather <nil> I'm guessing...
>
> mysql query doesn't like my trying to pass NOTHING.
>
> I COULD go through each of the 50 returned variables and, if they are not
> "1", assign "0" to them.
>
> But I'm wondering if there is a better way to go about this??
>
> Thanks,
> Paul
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to