in reply to Problem passing date to SQL
rowsi.e. that's not how rows works. What happens when you run
$rv = $sth->rows;
Returns the number of rows affected for updates, deletes and inserts and -1 for selects.
I also note in your posted code, you are calling fetchrow_array on $sth_1 and not $sth, which is the SQL you prepare. Please make sure code you post actually runs; perhaps are testing the wrong statement handle in your original code as well? How do I post a question effectively?$sth->execute($date) or die "Couldn't get values from table: " . DBI-> +errstr; my @data; while (my @row = $sth->fetchrow_array) { @data = @row; } if (@data) { local $" = ','; print "@data\n"; } else { "0 results\n"; exit; }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem passing date to SQL
by JoeTheProgrammer (Novice) on Aug 18, 2015 at 15:40 UTC | |
by choroba (Cardinal) on Aug 18, 2015 at 15:43 UTC | |
by kennethk (Abbot) on Aug 18, 2015 at 17:53 UTC | |
by GotToBTru (Prior) on Aug 18, 2015 at 16:18 UTC |