in reply to If no results come back ...
if($id) { $sql = "SELECT count(*) FROM category WHERE parent = '$id'"; } else { $sql = "SELECT count(*) FROM category WHERE parent = '0'"; } $sth = $dbh->prepare($sql) || die "Error: $!"; $sth->execute or die $dbh->errstr; my ($count) = $sth->fetchrow_array; if ($count > 0) { print qq... <Then fire the sQL which gets the data>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: If no results come back ...
by andrew (Acolyte) on Jul 21, 2002 at 03:31 UTC | |
by Anonymous Monk on Jul 21, 2002 at 03:52 UTC | |
by andrew (Acolyte) on Jul 21, 2002 at 04:18 UTC | |
by rdfield (Priest) on Jul 21, 2002 at 09:52 UTC |