Jump to content

[SOLVED] $variable set in one spot, not in the other?


suttercain

Recommended Posts

Hi everyone,

 

I am helping a friend with some code and we came across a weird issue we can't seem to solve:

<?php

       while ($fleet=mysql_fetch_assoc($r_lm)) {
       $i++;
       echo'<tr SPAN class=\'d'.($i & 1).'\'>';
       $t="editfleet.php?type=".$fleet['type']."&s=".$fleet['serial']."&mfr=".$fleet['engmfr']."&mod=".$fleet['engmodel'].
   "&emy=".$fleet['engmy']."&bmy=".$fleet['busmy']."&f=".$fleet['fuel']."&d=".$fleet['decs'];
   echo'<td align="center" style="background-color:#cccccc"><SPAN class=content>' . $i . '</SPAN></td>
        <td align="center"><SPAN class=content><a href="'.$t.'" target="_blank">' . $fleet['qty'] . '</a></SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['type'] . '</SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['engtype'] . '</SPAN></td>
          <td align="center"><SPAN class=content>' . $fleet['engmfr'] . " ". $fleet['engmodel'] . '</SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['engmy'] . '</SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['busmy'] . '</SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['fuel'] . '</SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['decs'] . '</SPAN></td>
        <td align="center"><SPAN class=content>'; if ($fleet['qty']==1) echo $fleet['busid']; echo'</SPAN></td>
        <td align="center"><SPAN class=content>' . $fleet['serial'] . '</SPAN></td>
          <td align="center"><SPAN class=content>' . $fleet['install'] . '</SPAN></td>
        </SPAN></tr>';
} 

?>

 

As you can see in the code we set $t to equal a string of other variables from our MySQL query... now in that string is .$fleet['serial']. which is not showing up when we echo out the $t in a link (which is also in the code above) but all the other variables show up fine. But the .$fleet['serial']. echos with no problem when it is alone in a table cell, in that same code.

 

I have no clue as to what we are doing wrong. Any advice?

 

Thanks.

 

 

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.