Try the following:
PHP Code:
// lotteryadmin.php, find:
$tickets = $DB_site->num_rows($ticketfetch);
if ($tickets == 0)
{
define('CP_REDIRECT', 'lotteryadmin.php?do=edit');
print_stop_message('rpg_lottery_ticket_error');
}
// move to AFTER the following
$lotteryinfo = $DB_site->fetch_array($ticketfetch);
// Replace:
$tickets = $DB_site->num_rows($ticketfetch);
// With:
$tickets = count($lotteryinfo);
If this works, I'll release it as an official fix (and also patch the mistake of forgetting to add that phrase to the XML file).