Jump to content

[SOLVED] else if not working???


blueman378

Recommended Posts

Hi guys i have this code...

<?php
global $database;
    $q = "SELECT cName FROM " . gsubcat . "
          ORDER BY `cName` ASC
         ";   
    $result = $database->query($q) or die("Error: " . mysql_error()); 
    /* Error occurred, return given name by default */
    $num_rows = mysql_numrows($result);
while( $row = mysql_fetch_assoc($result) ) { 
$cat1 = $row[cName];
$cat2 = $row[cName];
if ($cat1 == "Action / Adventure")
    { $cat2 = "Action"; }
elseif ($cat1 == "Shoot em up")
{ $cat2 = "Shoot"; }
elseif ($cat1 == "Beat em up")
{ $cat2 == "Beat"; }
else { $cat2 = $cat1; }
?>
<div class="cntttl">
<div class="cntbox">
<div class="cntbox_head"><div><table cellspacing="0" width="100%">
<tbody><tr>
<td><h1><?php echo $row[cName]; ?> Games</h1></td>
<td class="blockheaderlink">

<a linkindex="72" href="catcontents.php?cat=<?php echo $row[cName]; ?>">More <?php echo $row[cName]; ?> Games  <img src="images/more.png" align="absmiddle"></a>  </td>
</tr>
</tbody></table></div></div>
<div class="cntbox_cnt"><?php include("scripts/$cat2.php"); ?></div>
<div class="cntbox_foot"><div><div></div></div></div>
</div>
</div>
<?php
}
?>

 

which works perfectly except for one thing,

 

the Beat em up elseif statment is having no effect, the action adventure one and shoot em up are but the beat em up is not

 

i should get Beat.php but instead im getting Beat em up.php,

 

|ay ideas?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.