hi all,

i want to use the mysql password() function in my perl script. The function of my script is to insert values into mysql table.
below is a snippet of mysq script:


#######################################################
use DBI;

$database="vpdn";
$host="localhost";
$user="db";
$pw="mysql";

print "Username: ";
chomp ($username=<STDIN>);
print "Password: ";
chomp($pass=<STDIN>);
print "Description: ";
chomp ($desc=<STDIN>);
print "Reply Attributes: ";
chomp($replyattr=<STDIN>);


$dbh=DBI->connect("DBI:mysql:database=$database;host=$host",$user,$pw, {RaiseError => 1});


my $sth = $dbh->prepare(q{INSERT INTO MYTABLE (USERNAME,PASSWORD) VALUES (?, ?)
         }) or die $dbh->errstr;
        $sth->execute($username,$pass) or die $dbh->errstr;
$dbh->disconnect;
######################################################################

I tried using the following:

my $sth = $dbh->prepare(q{INSERT INTO MYTABLE (USERNAME,PASSWORD) VALUES (?, ?)
         }) or die $dbh->errstr;
         $sth->execute($username,PASSWORD('$pass')) or die $dbh->errstr;
$dbh->disconnect;

but i got this error:

Undefined subroutine &main::PASSWORD called at ./adduser.pl line 30, <STDIN> line 4.

Any suggestions?


--------------------------- cheers, jaws

If there's one thing you need to remember it's this...
ALL SYSTEMS ARE VULNERABLE!




-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to