bkiahg has asked for the wisdom of the Perl Monks concerning the following question:
Doing a very simple SELECT query and I'm not sure whats going wrong. It works fine when I do the WHERE statement pointing at one of the columns other than the primary key (weight). But as soon as I try and do a SELECT on the primary key the query hangs. Also this SELECT query works fine from the MySQL Administration program but always hangs through perl.
I've tried using placeholders, placing quotes around the number, leaving quotes out. It always seems to just hang. Any thoughts on what I'm missing here?
EDIT: This is also on a Windows Server 2003 box. FYI.
UPDATE: Gave up. Switched to an ODBC connection and it works like intended...
Here is the table information from a "DESCRIBE rates";my $query_submitted = "SELECT * FROM rates WHERE weight = 2"; # Hangs my $query_submitted = "SELECT * FROM rates WHERE zone2 = '4.67'"; # Wo +rks fine
Field | Type | Null | Key | Default | Extra |
weight | int(11) | NO | PRI | auto_increment | |
zone2 | varchar(45) | NO |
I've tried using placeholders, placing quotes around the number, leaving quotes out. It always seems to just hang. Any thoughts on what I'm missing here?
Any help is appreciated. As always, thank you in advance.my $weight = 4; my $query_submitted = 'SELECT * FROM rates WHERE weight = ?'; # This executes the query my $sth_submitted = $dbh->prepare($query_submitted) or die "Error prep +are"; $sth_submitted->execute($weight) or die 'Error';
EDIT: This is also on a Windows Server 2003 box. FYI.
UPDATE: Gave up. Switched to an ODBC connection and it works like intended...
Back to
Seekers of Perl Wisdom