In Progress

Make a perl script do a database query (quick fix)

ERROR I GET AT THE END

DBD::mysql::st execute failed: Unknown column 'funguy' in 'field list'

###CODE ITSELF

my $encoded_pass = md5($params{passcode}); ### THIS LINE GIVES ERROR I NEED MD5 for password

my $usercode1 = $params{usercode};

my $query = "INSERT INTO signup SET username = $usercode1, pwd = $encoded_pass, paid = 1";

my $sth = $dbh->prepare($query);

$sth->execute;

my $id = $sth->insertid; ## THIS LINE GIVES ERROR .... this needs to be the last insert ID (like mysql_insert_id() in php

$query = "INSERT INTO users_prefs (UID) VALUES $id";

$sth = $dbh->prepare($query);

$sth->execute;

$dbh->disconnect;

##DB SETTINGS

my $host = "localhost";

my $database = "db";

my $tablename = "tablename";

my $user = "username";

my $pw = "password";

my $port = "3306";

my $dsn = "DBI:mysql:database=$database;host=$host;port=$port";

my $dbh = DBI->connect($dsn, $user, $pw) or die("Could not connect!");

Skills: Perl

See more: perl get, n query, make set, make line, need a quick mysql script, md5, fix mysql query, dsn, die line, dbh, db query, php script execute, fix query, connect database error, php mysql error unknown column, connect database mysql, unknown database, php script signup, database connect error, mysql connect database, php connect database, mysql uid, connect mysql database, php mysql database query, unknown column field list

About the Employer:
( 24 reviews ) Montreal, Canada

Project ID: #1264892

Awarded to:

antox

Hello. I can fix the code. Please see PM for more details.

$30 USD in 0 days
(4 Reviews)
2.4

5 freelancers are bidding on average $30 for this job

dims

Let me help you

$30 USD in 1 day
(116 Reviews)
6.1
gangabass

I can do this for you. See PM for details.

$30 USD in 0 days
(147 Reviews)
5.9
sunblink

can fix in 10 mins

$30 USD in 1 day
(4 Reviews)
3.4
programmingzeal

Dear, Expert Perl programmer here. Please check PMB. Thanks

$30 USD in 1 day
(7 Reviews)
3.2
dracco

I can fix that for you. I'm ready to start right away. Best regards.

$30 USD in 0 days
(3 Reviews)
2.4