Jump to content

A Slight, Undefined Problem


jedney

Recommended Posts

Hello.

 

First off, thank everyone for their help.  I've made a few posts over the past 4 weeks, and I am almost completed with my site with the exception of this small problem.

 

I am running everything off one page, and it's been going great.  I'm running off a database, pulling specific information to style the pages.  I'd like to focus on these 2 pages:

http://www.nlgaming.net/b2/beta.php?game=dod&page=roster

http://www.nlgaming.net/b2/beta.php?game=css&page=roster

 

They are identical.  It is the exact same code that creates them.  As you can see in the first link, the table header is repeating itself.  If it is the exact same code generating each page, how come the second link is perfect?  Below is the code for this section.  Thank you in advance.

 

If the entire page code is needed to assist me, here is a link to the source:

http://www.nlgaming.net/b2/beta.phps

 

<?php 
if(isset($_GET['game']) && ($_GET['page'] == 'roster')) {
					// START ROSTER	
						if (isset($_GET['id']))
  {
  $query = "SELECT * FROM {$_GET['game']}_roster WHERE id='{$_GET['id']}'";
    $result = mysql_query($query) or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
     $query1 = "SELECT * FROM {$_GET['game']}_header";
     $result1 = mysql_query($query1) or die(mysql_error());
     while ($row1 = mysql_fetch_array($result1)){
        echo"

        <td valign=\"top\" class=\"NewsHeader\">     ". $row['name'] ."</td>
      </tr>
      <tr>
        <td class=\"normbold\">Member Information</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['name'] . ": ". $row['rlname'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['dob'] . ": ". $row['dob'] ."</td>
        </tr>
      <tr>
        <td class=\"norm\">" . $row1['location'] . ": ". $row['location'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['rank'] . ": ". $row['rank'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['recruitment'] . ": ". $row['joindate'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\"> </td>
      </tr>
      <tr>
        <td class=\"normbold\">Contact Information</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['email'] . ": ". $row['email'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['steam'] . ": ". $row['steam'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['aim'] . ": ". $row['aim'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['msn'] . ": ". $row['msn'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['yahoo'] . ": ". $row['yahoo'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['xfire'] . ": ". $row['xfire'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['gsc'] . ": ". $row['gsc'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\"> </td>
      </tr>
      <tr>
        <td class=\"normbold\">Game Information</td>
      </tr>
      <tr>
        <td class=\"norm\"><p>" . $row1['experience'] . ": ". $row['exp'] ."</p>          </td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['class1'] . ": ". $row['allies'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['class2'] . ": ". $row['axis'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['map'] . ": ". $row['map'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\">" . $row1['type'] . ": ". $row['playertype'] ."</td>
      </tr>
      <tr>
        <td class=\"norm\"> </td>
      </tr>"; }}
  } else {
  	$query = "SELECT * FROM {$_GET['game']}_roster";
    	$result = mysql_query($query) or die(mysql_error());
   		while ($row = mysql_fetch_array($result)) {
     $query1 = "SELECT * FROM {$_GET['game']}_header";
     $result1 = mysql_query($query1) or die(mysql_error());
     while ($row1 = mysql_fetch_array($result1)){
        ?> 

  <tr>

        <td colspan="6" valign="top" class="NewsHeader">      <?php echo"$longname"; ?> Squad Roster</td>
      </tr>
      <tr>
        <td class="normbold"><?php echo"" . $row1['name'] . "" ?></td>
        <td class="normbold"><?php echo"" . $row1['rank'] . "" ?></td>
        <td class="normbold"><?php echo"" . $row1['steamid'] . "" ?></td>
	<td class="normbold"><?php echo"" . $row1['class1'] . "" ?></td>
	<td class="normbold"><?php echo"" . $row1['class2'] . "" ?></td>
        <td class="normbold">Recruitment Date</td>
      </tr> <?php }}
      // DISPLAY NEWS INFORMATION
    $query = "SELECT * FROM {$_GET['game']}_roster WHERE recruit='0'";
    $result = mysql_query($query) or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
        echo "<tr><td class=\"norm\"><a href=\"?game=$game&page=roster&id=". $row["id"] ."\">". $row["name"] ."</a></td>";
	echo "<td class=\"norm\">". $row['rank'] ."</td>";
        echo "<td class=\"norm\">". $row['steamid'] ."</td>";
        echo "<td class=\"norm\">". $row['allies'] ."</td>";
        echo "<td class=\"norm\">". $row['axis'] ."</td>";
        echo "<td class=\"norm\">". $row['joindate'] ."</td>";
      echo "</tr>"; } }?>
      <tr>

        <td class="norm"> </td>

      </tr>
      
					<?php // END ROSTER
} else {

Link to comment
https://forums.phpfreaks.com/topic/95717-a-slight-undefined-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.