Thx for the feeback, but no luck so far.

Running:
DBI: 1.42
DBD:CSV: 0.22
Perl 5.6.1

New code I copied & pasted to attempt to get it working:

#!c:/apache/perl/bin/perl.exe -wT BEGIN { $| = 1; open (STDERR, ">&STDOUT"); print qq~Content-type: text/html\n\n~; } use CGI qw/:standard/; use strict; use Data::Dumper; use DBI; my $foo = new CGI; print $foo->header; # Connect to the database, (the directory containing our csv file(s)) my $dbh = DBI->connect("DBI:CSV:f_dir=.;csv_eol=\n;"); # Associate our csv file with the table name 'test2' $dbh->{'csv_tables'}->{'test2'} = { 'file' => 'test2.csv'}; # Output the name and contact field from each row my $sth = $dbh->prepare("SELECT * FROM test2 WHERE name LIKE 'G%'"); $sth->execute() or die "Can't execute the query: $sth->errstr"; while (my $row = $sth->fetchrow_hashref) { print("name = ", $row->{'Name'}, " contact = ", $row->{'Contact'} +. "\n"); } $sth->finish();

CSV file that is being used for test2.csv:
"Name","Address","Floors","Donated last year","Contact" "Charlotte French Cakes","1179 Glenhuntly Rd",1,"Y","John" "Glenhuntly Pharmacy","1181 Glenhuntly Rd",1,"Y","Paul" "Dick Wicks Magnetic Pain Relief","1183-1185 Glenhuntly Rd",1,"Y","Geo +rge" "Gilmour's Shoes","1187 Glenhuntly Rd",1,"Y","Ringo"

The error I'm getting is:
Content-Type: text/html; charset=ISO-8859-1 Execution ERROR: Missing f +irst row at c:/apache/Perl/site/lib/DBD/CSV.pm line 165, line 1. . DB +D::CSV::st fetchrow_hashref failed: Attempt to fetch row from a Non-S +ELECT statement [for statement ``SELECT * FROM test2 WHERE name LIKE +'G%''']) at /apache/htdocs/test2.cgi line 26.

Any other suggestions? I appreciate your help/feedback guys...

Stenyj

In reply to Re^2: DBD::CSV - missing first row? by Stenyj
in thread DBD::CSV - missing first row? by Stenyj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.