in reply to fetchrow_array DBI

When I used the following code after the #!..perl line
use CGI::Carp "fatalsToBrowser"; use strict; use CGI; use DBI;

it seemed to work, but then again i did use a different perl file I was using. Would it make that much of a difference?

As for a few other questions, I am using "SAMS CGI (2nd ed.)" and "DEITEL How to Program." Yes I've seen a few $dbh->do(); statements in the Deitel book. Is that wrong or dangerous?

I thank you all for helping me.

Replies are listed 'Best First'.
Re: Re: fetchrow_array DBI
by dws (Chancellor) on Feb 02, 2004 at 02:50 UTC
    Yes I've seen a few $dbh->do(); statements in the Deitel book. Is that wrong or dangerous?

    do() isn't at all dangerous, but it is reserved for SQL statements that don't return data.

    $dbh->do("DELETE FROM foo WHERE bar = 47");
    is O.K., but
    $dbh->do("SELECT bar FROM foo");
    isn't. This is spelled out in the on-line DBI documentation.