connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']');
}
if (!$_SESSION['userid']){
echo '
Please login first';
echo '';
} else {
if ($whattoon == "0" or $whattoon == ""){
$sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '$userid' ORDER BY `charname` ASC"; //need to make userid a variable
if (!$result = $con->query($sql)){
die ('There was an error running the query [' . $con->error . ']');
}
echo 'Character Selection';
echo '
';
echo '';
} else {
$sqltoon = "SELECT charname, profcolor from `playername` WHERE playerid = $whattoon";
if (!$result2 = $con->query($sqltoon)){
die ('There was an error running the query [' . $con->error . ']');
}
while ($row2 = $result2->fetch_array()){
$charactername = $row2['charname'];
$profcolor = $row2['profcolor'];
$_SESSION['profcolor'] = $profcolor;
echo '' . $charactername . '';
echo '';
}
echo '
';
}
echo '
';
}
?>