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...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: MySQL 5.1.11 Select Query
by pc88mxer (Vicar) on Aug 05, 2008 at 15:36 UTC | |
by bkiahg (Pilgrim) on Aug 05, 2008 at 15:41 UTC | |
Re: MySQL 5.1.11 Select Query
by Illuminatus (Curate) on Aug 05, 2008 at 16:46 UTC | |
by bkiahg (Pilgrim) on Aug 05, 2008 at 17:17 UTC | |
Re: MySQL 5.1.11 Select Query
by perrin (Chancellor) on Aug 05, 2008 at 16:49 UTC | |
by bkiahg (Pilgrim) on Aug 05, 2008 at 17:35 UTC | |
by perrin (Chancellor) on Aug 05, 2008 at 18:32 UTC | |
by bkiahg (Pilgrim) on Aug 05, 2008 at 19:11 UTC | |
by perrin (Chancellor) on Aug 05, 2008 at 19:20 UTC | |
| |
Re: MySQL 5.1.11 Select Query
by jethro (Monsignor) on Aug 05, 2008 at 16:35 UTC | |
by bkiahg (Pilgrim) on Aug 05, 2008 at 17:53 UTC |
Back to
Seekers of Perl Wisdom