I'm not familier with the Mysql module. I'd suggest checking out DBI. DBI is an abstraction layer that allows you to connect to several different popular databases. Here's a quick example on using it with MySQL:
#!/usr/bin/perl use strict; use warnings; use DBI; my $dsn = "DBI:mysql:host=somehost;database=db-you-want"; my $dbh = DBI->connect($dsn,"user","password") or die "Couldn't connec +t: " . DBI->errstr(); my $query = "SELECT somestuff FROM sometable WHERE somefield='somethin +g'; my $sth = $dbh->do($query); while(my $somestuff = $sth->fetchrow()) { # do something interesting ... } $sth->finish(); $dbh->disconnect();
Hope that helps
chris
In reply to Re: My first MySQL database
by cfreak
in thread My first MySQL database
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |