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 <quickshiftin@xxxxxxxxx> wrote: > > On 11/2/07, Dan Shirah <mrsquash2@xxxxxxxxx> 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 > > > >