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


In reply to Re: Extracting data from mySQL by fokat
in thread Extracting data from mySQL by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.