on Wed, 03 Jul 2002 18:55:25 GMT, <[EMAIL PROTECTED]>
wrote:
> I've been lurking for a few months and figured I'd pose a question
> that I've been banging my head against for a while.
(I've already told this in another thread today:
Don't do this, it hurts :-)
> If anyone can recommend a good resource for DBI information I would
> be eternally grateful.
Book:
<http://www.oreilly.com/catalog/perldbi>
Introductory web article
<http://www.perl.com/pub/a/1999/10/DBI.html>
About your code. Did you slap on 'use strict;' afterwards?
Your code doesn't compile under strict. You have two undeclared variables
($sth and @row).
> [... code snipped ...]
> Use of uninitialized value in join or string at sqltest.pl line 11.
> 1 name t 0 0 0000-00-00 0000-00-00 0 0 cruise 0
You have a NULL value somewhere in your fetched record. Perl translates
this to undef, so one of the elements in @row is undef. Hence the
uninitialized value (print "@row" is essentially a 'print join " ",
@row;')
> 0 rows (19: fetch() without execute())
> DBD::mysql::st fetch failed: fetch() without execute() at
> C:/Perl/site/lib/DBI.pm line 830.
> fetch() without execute()
'dump_results' needs to fetch records behind the scenes, so you have to
execute your statement handle again, because you already exhausted it in
your while-loop.
--
felix
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]