use strict;
use DBI;
$dbh = DBI->connect("DBI:mysql:gds:localhost", "tools", "obviouslyfakepasswd") or die ("No love for the DBI connect");
$sql = qq{ SELECT uname, fname, fgroup, dmod, accts FROM noctracker WHERE uname = 'gwalker'} ;
$sth = $dbh->prepare( $sql ) or die ("Could not prepare select");
$sth->execute();
$sth->bind_columns( undef, \$uname, \$fname, \$fgroup, \$dmod, \$accts );
while ( $sth->fetch ) {
print "
Matched username $uname for name: $fname ";
}
$sth->finish();
$rc = $dbh->disconnect or die ("No love for the DBI disconnect");
&footer;
exit;
####
DBI::st=HASH(0x164ad0)
Matched username for name:
####
mysql> SELECT uname, fname, fgroup, dmod, accts FROM noctracker WHERE uname = 'gwalker';
+---------+----------------+---------+---------------+-------------------------------+
| uname | fname | fgroup | dmod | accts |
+---------+----------------+---------+---------------+-------------------------------+
| gwalker | Glen G. Walker | GDS-NOC | 20030820 1700 | BASTION SECUREID THEQ CLARIFY |
+---------+----------------+---------+---------------+-------------------------------+
1 row in set (0.00 sec)