in reply to Extracting data from mySQL
they're using phpBB which stores said user info in a mySQL database, which i have no experience with or knowledge about...
Well, I don't know what phpBB is, but in order to talk to a mySQL database, I suggest you use DBI along with the proper DBD (database driver) for this.
You can install the required software by doing the commands below (note that you may need super user privileges):
bash-2.05a# perl -MCPAN -e 'install "DBI"' bash-2.05a# perl -MCPAN -e 'install "Bundle::DBD::mysql"'
The book Programming the Perl DBI might be a very useful resource if you have the time and the money.
how could i easily get this user info and format it into either a hash or flat text file (whichever's easier)?
Your code would be somewhat similar to this untested example...
use DBI; my $dbh = DBI->connect($dsn, $login, $password, { RaiseError => 1 } ); my $sth = $dbh->prepare('/* some adequate SQL query */'); o o o $sth->execute($user); my $r_udata = $sth->fetchrow_arrayref; $sth->finish; # $r_udata is a reference to an array where each element matches # the corresponding column on the query passed to ->prepare() o o o $dbh->disconnect;
Please make sure to use placeholders when building your query. You can post more specific questions once you start coding.
Best regards
-lem, but some call me fokat
|
|---|