perl mysql
Kategorie: perl-awk-sed

#!/usr/bin/perl
use DBI;


$dbh = DBI->connect("DBI:mysql:database=jmenoDB;host=mysql.server.cz","user","heslo");
$sql = "SELECT * FROM `mailbox` WHERE active=1";
$sth = $dbh->prepare($sql);
$sth->execute();

while ($row_ref = $sth->fetchrow_hashref())
{
$u = $row_ref->{username};
print "$u $row_ref->{modified}\n";
}

$result = $dbh->disconnect;


18.1.2007 21:40:53