in reply to easier to get data from a database

Critisms: You're doing a describe on the table for each query which is inefficient (and not portable), your code doesn't handle any interesting queries (only select by ID specific values), and you should probably use $fetchrow_hashref instead of transforming the result of $fetchrow_array to a hash.

This has all been done before, also by me, and I learned a lot from it, but the main thing I learned is that doing it right takes a whole lot of effort. :-)

Take a look at Class::DBI and Class::DBI::Autoloader for a framework that tries to do it right (and mostly succeeds in my opinion). There is a list of different implementations here.