while ( $org = $orgid->fetch_array()) {
$getorg = "SELECT Name FROM organisations WHERE ID='" . $org['orgid'] . "'";
$orgname = $db->query($getorg) or die ($db->error());
if ( $org['orgid'] !== false ) {
echo("<td>" . $orgname->fetch_object()->Name . "</td>" );
$hasOrg = true;
}
else {
echo("<td>Player not in an org.</td>");
}
}
Here is my code, and above is the result (the link).
CG Staff is the organization, for players with it.
The query only has two results, so that is why it is returning true all the time. How, though, can I make it say something in the for rows in the table that don't have a result?