Ah, okay.  So I could probably simplfy it more by trimming it from the start
like this??

$due_date = trim($_POST['due_date']);


On 11/2/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
>
> On 11/2/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> >
> > Okay, so instead I should probably use:
> >
> > if($due_date != "")
> > $insert2.=", due_date='$due_date'";
> >
> > Instead of using empty()
> >
>
>
> using emtpy is fine; just store the results of trim in a temporary variable:
>
> $trimmed = trim($due_date);
> if(!empty($trimmed)) {
>
>  $insert2 .= ", due_date='$due_date'";
>
> }
>
> -nathan
>
>
>
>

Reply via email to