in reply to Re: Re: Re: HTML::Template-Displaying DB Records-Still struggling
in thread HTML::Template-Displaying DB Records

First, I would chasnge that while $_ = $sth->fetchrow_hashref() into a simple for loop. It's just a little confusing right now, and hard to tell if there may be some strange scoping issue going on. Don't use $_ for this.

Then I would break it down some more. Try running just this section of code in a separate script (after providing a $dbh of course).

You should pass the RaiseError option to DBI, because you are not checking return values for errors here. You should also use bind variables. I'm not sure where you got the idea that bind variables don't work with LIKE queries. They work just fine, and will make your code more robust.

  • Comment on Re: Re: Re: Re: HTML::Template-Displaying DB Records-Still struggling
  • Download Code