Bryan Harris wrote: > I've been enjoying perl for almost 2 years now, and I think I'm ready to > step into interacting with a database. (big step!) > > I have mysql, and I have some simple tables.
In what database? MySQL can access any number of databases. The only built-in one are mysql, the administrative db, and test, an empty database on which to test. If you have tables in this database with known structure and values, it should be easy to test. > Now I want to be able to > access those tables from perl. Can anyone offer a simple tutorial on how to > do this? > > Thanks!!! Here is my own first successful access of MySQL from Perl: Greetings! E:\d_drive\perlStuff>perl -w -MDBI -MDBD::mysql my $dbh = DBI->connect("DBI:mysql:database=RJNTest;host=localhost", "root", ""); my $sth = $dbh->prepare("select * from test2"); $sth->execute; { no warnings 'uninitialized'; while (my $ref = $sth->fetchrow_hashref()) { print "$_: $ref->{$_}\n" foreach keys %$ref; print "\n\n"; } } finish $sth; ^Z Phone: ID: 1 Address: 1033 Tennessee Name: Joseph Newton ... [four other addresses and names] The blank root password is not a good idea, but without production data in the DB, its no big problem either. You should do at least some MySQL work from the command line before you try to access it programmatically, though. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]