Ok, I think I can fix the bug with all the companies showing up for every bio no matter what company the bio belongs to by adding an && operator to the if statement like this.
echo "<b><u>Darkhorse Comics Characters</u></b><br>";
// display individual record
if (($id) && ($company == "Darkhorse Comics"))
{
$result = mysql_query("SELECT * FROM cbd_darkhorse WHERE id=$id", $db);
$myrow = mysql_fetch_array($result);
printf("<p align=center> %s\n<br /></p>", $myrow['image']);
printf("<b>Company:</b> %s\n<br>", $myrow['company']);
printf("<b>Name:</b> %s\n<br>", $myrow['name']);
printf("<b>Real Name and Aliase(s):</b> %s\n<br>", $myrow['realname']);
printf("<b>Legal Status:</b> %s\n<br>", $myrow['legalstatus']);
printf("<b>First Appearance:</b> %s\n<br>", $myrow['firstappearance']);
printf("<b>Group Affiliation:</b> %s\n<br>", $myrow['team']);
printf("<b>Height:</b> %s\n<br>", $myrow['height']);
printf("<b>Weight:</b> %s\n<br>", $myrow['weight']);
printf("<b>Hair Color:</b> %s\n<br>", $myrow['hair']);
printf("<b>Eye Color:</b> %s\n<br>", $myrow['eyes']);
printf("<b>Identifying Features:</b> %s\n<br>", $myrow['featurest']);
printf("<b>Powers and Abilities:</b> %s\n<br><br>", $myrow['powers']);
printf("<b>Known Weaknesses:</b> %s\n<br><br>", $myrow['weakness']);
printf("<b>History/Comments:</b> %s\n<br>", $myrow['history']);
// single quotes marks array pointers
}
else
{
// show character list
$result = mysql_query("SELECT * FROM `cbd_darkhorse` ORDER BY 'company',`name` ASC", $db);
I'll have to add that && operator (changing the variable for each company) to each if statement in the script, but I think it should work.
I can't try it now, because I'm not at home and don't have ftp access, but I've been reading my php book and I think I found a way to fix that bug! 🙂🙂🙂