suttercain Posted May 2, 2007 Share Posted May 2, 2007 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. Link to comment https://forums.phpfreaks.com/topic/49715-solved-variable-set-in-one-spot-not-in-the-other/ Share on other sites More sharing options...
Psycho Posted May 2, 2007 Share Posted May 2, 2007 What kind of values does $fleet['serial'] contain? Have you check the actual HTML code that is output to the browser. If everything checks out I would try extracting serial using an alias - perhaps the issue is 'serial' is reserved? Link to comment https://forums.phpfreaks.com/topic/49715-solved-variable-set-in-one-spot-not-in-the-other/#findComment-243827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.