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?
--In reply to DBI problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |