Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I'm having a little trouble with DBI...
<snip> $dbqpinfo = $dbh->prepare(q{SELECT ? FROM pinfo WHERE name = ?}) or die "Unable to prepare 'dbqpinfo': " . $dbh->errstr . "\n"; <snip> if ($type eq "password") { my $name = $login{$client}{'name'}; $dbqpinfo->execute('passwd', "$name") or die "Unable to execute dbqpinfo: " . $dbh->errstr . "\n"; my $password = $dbqpinfo->fetchrow_array(); if (crypt("$input", 'llama') eq $password) { $user{$client} = $name; $client{$name} = $client; delete $login{$client}; } else { $outbuffer{$client} .= "Incorrect password for $name! (disco use +r)"; } } <snip>
The database has the columns name, passwd, created and laston.
Whenever this bit of code is called, $password gets 'passwd' (the column name!?). I've tried lots of different things with arrays, arrayrefs and the like, but I really don't know what is going on :(
Can anyone see anything I missed?
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI problem
by chromatic (Archbishop) on Jan 16, 2003 at 19:46 UTC | |
by Anonymous Monk on Jan 16, 2003 at 20:07 UTC | |
|
Re: DBI problem
by pfaut (Priest) on Jan 16, 2003 at 19:47 UTC | |
|
Re: DBI problem
by valdez (Monsignor) on Jan 16, 2003 at 19:54 UTC | |
|
Re: DBI problem
by runrig (Abbot) on Jan 16, 2003 at 19:47 UTC | |
|
Re: DBI problem
by Fletch (Bishop) on Jan 16, 2003 at 20:27 UTC | |
|
Re: DBI problem
by OM_Zen (Scribe) on Jan 17, 2003 at 21:07 UTC |