in reply to Failing when called by another script

Without seeing the actual error message generated, only the most general advice can be given:
  • Use placeholders instead of interpolated values (security and performance)
  • The 'die' message after both the parse and the execute uses $sql as a reference, when it's clearly initialised as a string.
  • I think that @remove_dates should be initialised as my @remove_dates = split /\0/,$query->param{remove}; since CGI.pm returns a single string, not an array.

    rdfield

  • Replies are listed 'Best First'.
    Re: Re: Failing when called by another script
    by davis (Vicar) on Mar 08, 2002 at 12:01 UTC
      I think that @remove_dates should be initialised as my @remove_dates = split /\0/,$query->param{remove}; since CGI.pm returns a single string, not an array.

      I don't think that's actually what happens. If you pass a multivalued paramater, (such as a checkbox_group), CGI.pm will return an array.
      From perldoc CGI.pm:
      FETCHING THE VALUE OR VALUES OF A SINGLE NAMED PARAMETER: @values = $query->param('foo'); -or- $value = $query->param('foo'); Pass the param() method a single argument to fetch the value of +the named parameter. If the parameter is multivalued (e.g. from mult +iple selections in a scrolling list), you can ask to receive an array +. Otherwise the method will return a single value.

      Regards,
      davis
      Is this going out live?
      No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist