[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] dbh->quote error I can't see


On Nov 29, 2004, at 12:19 PM, Michael Peters wrote:

The error message doesn't mean that $authcode, $reqname, $created_ip don't have values but that your $dbh is undefined. Test what you're $dbh is before you call quote(). You're pulling it from the param() but not checking to see if it's defined.

Thank you Michael. $dbh was definitely the culprit.

On Nov 29, 2004, at 12:23 PM, Jaclyn Whitehorn wrote:

I think it's not saying that $authcode is undefined, it's saying that $dbh is. Looking at:

	my $dbh = $q->param( 'mydbh' );

Yes that was the problem.
Thank you Jaclyn.

On Nov 29, 2004, at 1:08 PM, Cees Hek wrote:


This seems to be a lot of work to just update a couple of values in
the database.  I would recommend using one of the many DBI wrappers
available on CPAN.  See the following article for an overview of the
most popular ones:
http://poop.sourceforge.net/

As an example I'll show you how the above could work if you used Class::DBI.

One step at a time. I'm still getting my app moved over to C::A, but I plan to check it out.

I seem to do a lot of redirecting, so I created a very simple redirect
function that saves me from remembering how to do it in
CGI::Application.

sub redirect {
  my $self = shift;
  my $location = shift;

  $self->header_add(-location => $location);
  $self->header_type('redirect');
  return '';
}

Now in my runmodes I can just do:

return $self->redirect('../cgi-bin/asep.cgi?rm=error');

Which saves me a few keypresses, and I don't have to bother checking
the docs on how header_type works everytime (I have a short memory ;)


Thanks Cees, that works great.

Thank you to all who responded. I only wish that I had asked earlier. You are all very helpful.

Ed Pigg


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.