prepare("INSERT INTO gwaccounts (userid, accemail) VALUES (?, ?)");
$addacc->bind_param("is", $_SESSION['userid'], $_POST['accemail']);
$addacc->execute();
$addacc->close();
echo 'New account added, returning to editor.';
header ("Refresh:1; url=addaccounts.php");
exit();
}
if (!empty($_POST['delchar'])) {
echo 'removing selected character(s) from selected account
';
$delchar = $con->prepare("DELETE FROM gwchars WHERE charid = ? AND accid = ? AND userid = ?");
$delchar->bind_param("iii", $_POST['charid'], $_POST['accid'], $_SESSION['userid']);
$delchar->execute();
$delchar->close();
echo 'Need to figure out code to delete stats related to this character still!
';
//header ("Refresh:1; url=addacounts.php");
//exit();
}
echo '
| Account name |
|---|
| '; if ($row['accid'] == $_SESSION['prefaccid']) { echo '' . $row['accemail'] . ''; } else { echo $row['accemail']; } echo ' |