I'm running a test to see whether certain criteria in a SELECT statement return record or not. If I get a "no rows selected" from SQL then I want to perform a specific action . But I don't how perform the test for "no rows selected " ?
$sql = qq{SELECT RECORD FROM TABLE WHERE FIELD = ? } ;
$sth = $dbh->prepare($sql) ;
$sth->execute($variable) ;while (@fetch = $sth4->fetchrow)
{
if ("no rows selected " .................?????? ) ### Don't know how to test this
{
#perform my tasks
}
Regards, Mark
