DelphiFAQ Home Search:
General :: Programming :: perl :: mysql
How to work mysql from perl. This site is mainly built with mysql and perl (and some php)

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Getting started with perl and mysql

This is an example how to get started. Obviously you'll need to change the name of the database, user and password to reflect your environment. Also you need to have DBI and DBD::mysql installed on the server.

use Mysql;
 
 $db = Mysql->Connect('localhost', 'databasename', 'username', 'password');
 
 $sth = $db->Query('select user_id, user_name from users');
 
 while (($user_id,$user_name)=$sth->FetchRow()) {
   print "$user_id: $user_name\n";
 }

Generated 8:01:58 on Dec 13, 2017