in reply to Re: Re: small cgi output problem
in thread small cgi output problem

Pragmatically speaking, if there are no rows returned, the fetch*() call won't loop very many times. (Assuming 'zero' is akin to 'not very many').

The practical approach would be to issue a SELECT COUNT(*) query, which makes the database do the counting.

Replies are listed 'Best First'.
Re: Re: Re: Re: small cgi output problem
by Anonymous Monk on Apr 09, 2001 at 21:11 UTC
    whats the correct syntax in perl for that selection with regard to the $sth5 selection step

      What chromatic is saying is that if you want to see the number of rows a query will return, a good way is to issue an explicit SELECT COUNT(*) FROM tablename WHERE field_value = whatever and get the return value BEFORE you issue the SELECT to get the value.

      Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re: Re: Re: Re: small cgi output problem
by suaveant (Parson) on Apr 09, 2001 at 21:13 UTC
    With the MySQL DBI it will allow you to call fetchrow forever if nothing is returned. Throwing errors.
                    - Ant