there are no rows that have blank info
How have you verified this?
Here is redraft of the code with some of what morgon was discussing and what I'd call better practices (declare vars as used, RaiseError, lowercase var names, etc). Note that qq is the same as ". So qq~fatalsToBrowser~ is just a confusing way to write "fatalsToBrowser" (or 'fatalsToBrowser' since there is no interpolation). A more common operator for export lists is qw which will apply quotes to a "list."
use warnings; use strict; use DBI; use CGI::Carp qw( fatalsToBrowser ); use CGI qw( header ); use HTML::Entities qw( encode_entities ); # Updated and below. my $attr = { RaiseError => 1 }; my $statement = <<""; SELECT top 1 Quote, CharacterName, GameTitle FROM dbo.GameQuotes ORDER BY +newid() my $dbh = DBI->connect('dbi:ODBC:SQLServer', '', '', $attr) or die "$DBI::errstr"; my $sth = $dbh->prepare($statement); $sth->execute; my ( $quote, $character, $game ) = map { encode_entities($_) } $sth->fetchrow_array; print header(); print <<""; <blockquote> <p>$quote</p> <cite>–$character <br /> $game</cite> <blockquote> $dbh->disconnect;
In reply to Re: Pulling a blank SQL row, but there are no blank rows.
by Your Mother
in thread Pulling a blank SQL row, but there are no blank rows.
by MatthewV
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |