http://www.perlmonks.org?node_id=243357

digger has asked for the wisdom of the Perl Monks concerning the following question:

Wise Monks,

I am searching a DBD:CSV database based on a unique key like 1234567801234. The code I am using is below:
my $query="SELECT * FROM $table WHERE (ukey = ?)"; my $sth=$dbh->prepare($query); $sth->execute($ukey);
where $ukey is from a hidden field in an html form.
I know everything up to this point works becasue if I change $query to  select * from $table where ukey = '1234567801234' I get the record back that I expect. But just using the posted code, I get nothing.

I thought it might be a quoting issue, but according to the docs, the use of placeholders takes care of those issues. I have other scripts performing searches that work just fine, but those scripts search text fields. I am assuming my problem is due to the fact that this is a number instead of text, but I am not sure how to get around the problem.

Help, I am very confused


Thanks much,

digger