Well I see two problems:
1. The database insert query is clearly incorrect, the syntax should be:
PHP Code:
$mysidia->db->insert("login_attempts", array("num_attempts" => $newattempts, "ip" => $ip, "delay_time" => $now));
2. You should not attempt to output text with echo in Mysidia Adoptables, as the string will be displayed on the header, which does not make sense. Instead, use this:
PHP Code:
$document = $mysidia->frame->getDocument();
$document->addLangvar('We\'re sorry, but there\'s been a serious error...');