Not showing anything

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Not showing anything

Post 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"
Post Reply