Page 1 of 1

Not showing anything

Posted: Wed Oct 06, 2010 4:47 pm
by CoolAsCarlito
Okay after thinking about it the part of the manager_ids or what not should be adding on to the WHERE clause. So ebw.manager_id = bio.id. I added that and now its going back to not showing anything at all for that table of data.

Code: Select all

function getWrestling($style, $id) {
$id=mysql_real_escape_string($id);
if ($style=='singles') { 
$query = "SELECT bio.charactername AS manager, ebw.finisher AS finisher, ebw.setup AS setup, ebw.music AS music FROM efed_bio_wrestling AS ebw JOIN efed_bio AS bio ON ( ebw.bio_id = bio.id) WHERE ( ebw.bio_id = '$id') AND ( ebw.manager_id = bio.id)";
$result = mysql_query($query) or die(mysql_error());
echo $query;
while ($row = mysql_fetch_array($result)){
?>
<h2>Wrestling</h2>
<table class="biotable" cellspacing="10px">
            <tr class="biotablerowb">
                <td class="biotableheadingb">Manager/Valet:</td>
                <td class="biotabledatab"><?php if (strlen ($row['manager']) < 1) {     print "N/A"; } else { print $row['manager'];}?></td>
            </tr>
            
            <tr class="biotablerowb">
                <td class="biotableheadingb">Finisher:</td>
                <td class="biotabledatab"><?php if (strlen ($row['finisher']) < 1) {     print "N/A"; } else { print $row['finisher'];}?></td>
            </tr>
            
            <tr class="biotablerowb">
                <td class="biotableheadingb">Setup:</td>
                <td class="biotabledatab"><?php if (strlen ($row['setup']) < 1) {     print "N/A"; } else { print $row['setup'];}?></td>
            </tr>
            
            <tr class="biotablerowb">
                <td class="biotableheadingb">Entrance Music:</td>
                <td class="biotabledatab"><?php if (strlen ($row['music']) < 1) {     print "N/A"; } else { print $row['music'];}?></td>
            </tr>
        </table>    
<?php } }?>  
Here's the table structure:

efed_bio
id
charactername

efed_bio_wrestling
bio_id
manager_id
finisher
setup
music

It has the bio_id of the wrestler and what it's supposed to do is get the manager_id and then take it to the efed_bio table and match that to the same integer and when it finds a match record then get that person's charactername and if there is a 0 for the value inside of manager_id then it says "N/A"