in reply to Extracting data from mySQL

since i've recently been doing lot's of db stuff lately (for me anyway) and you seem to have little db/SQL experience at all... i'd say skip to the next level up and use Class::DBI which sits atop Ima::DBI and DBI and does alot of work for you.

assuming...

#!/usr/bin/perl use strict; use warnings; # a database - 'phpbbdb' # a database user - 'dbuser' # a database password - 'dbpass' # a table - 'passwords' # # mysql> describe passwords; # +--------+--------------+------+-----+---------+-------+ # | Field | Type | Null | Key | Default | Extra # | # +--------+--------------+------+-----+---------+-------+ # | user | varchar(16) | | PRI | | # | # | passwd | varchar(128) | YES | | NULL | # | # +--------+--------------+------+-----+---------+-------+ # # mysql> select * from passwords; # +-------+------------+ # | user | passwd | # +-------+------------+ # | walla | washington | # +-------+------------+ package MyDB; use base 'Class::DBI'; MyDB->set_db( 'Main', 'dbi:mysql:database=phpbbdb', 'dbuser', 'dbpass' ); package MyPasswords; use base 'MyDB'; MyPasswords->table( 'passwords' ); MyPasswords->columns( All => qw/ user passwd / ); package main; die << "_USAGE_" unless @ARGV; Usage: $0 <username> [<username> ...] Display the password(s) for username(s)! _USAGE_ foreach my $user (@ARGV) { my $info = MyPasswords->retrieve( $user ); printf "user: %s password: %s$/", $info->user(), $info->passwd(); } exit;

and a little test

$ test.pl walla
user: walla password: washington
$

Update/Addendum: the users will really hate it if they end up having to login twice. phpBB may be using cookies for session management, and may store some of that info in the database as well. it would be ideal if your script could arrange to have the cookie passed to it as well and use the cookie contents and a database query to allow access instead of asking for username/password again.