$dbh = DBI->connect('dbi:mysql:www','chef','grok',{PrintError=>0});
$dbh->disconnect; # (when done)
|
$count = $dbh->do('UPDATE ProductList SET SET price=price-(price*0.20)');
die $dbh->errstr unless defined $count;
|
$sth = $dbh->prepare('SELECT catalog,name FROM ProductList')
|| die $dbh->errstr;
$sth->execute() || die $sth->errstr;
while (my ($catalog,$name) = $sth->fetchrow_array) {
print "catno => $catalog, name => $name\n";
}
$sth->finish;
|
|
| Contents | Next |