What part of this task are you stuck on? Perhaps you should have a look at the TutorialsThe fine art of database programming and DBI recipes, along with the modules DBI and DBD::mysql. DBI has good documentation and example code which you should find pretty easy to understand. If you have any problems, let us know