coyotlgw has asked for the wisdom of the Perl Monks concerning the following question:
and the output, oddly enough is:use strict; use DBI; $dbh = DBI->connect("DBI:mysql:gds:localhost", "tools", "obviouslyfake +passwd") or die ("No love for the DBI connect"); $sql = qq{ SELECT uname, fname, fgroup, dmod, accts FROM noctracker WH +ERE 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 "<BR> Matched username $uname for name: $fname "; } $sth->finish(); $rc = $dbh->disconnect or die ("No love for the DBI disconnect"); &footer; exit;
Which is not what expected... that query works from the msql command line...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 SECUREI +D THEQ CLARIFY | +---------+----------------+---------+---------------+---------------- +---------------+ 1 row in set (0.00 sec)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Another meek DBI question
by antirice (Priest) on Aug 21, 2003 at 22:14 UTC | |
by mpeppler (Vicar) on Aug 22, 2003 at 11:11 UTC | |
|
Re: Another meek DBI question
by dws (Chancellor) on Aug 22, 2003 at 01:29 UTC | |
|
Re: Another meek DBI question
by krisahoch (Deacon) on Aug 21, 2003 at 22:18 UTC | |
by chromatic (Archbishop) on Aug 21, 2003 at 22:31 UTC | |
by blokhead (Monsignor) on Aug 21, 2003 at 22:28 UTC |