in reply to MySQL logic

I recommend you pick up a copy of Programming the Perl DBI. It's a much better guide to using DBI than Perlmonks. Of course, you could just read the manual (DBI) but the book is probably friendlier.

-sam