Hi All,
I am working on a set of PHP files for displaying data for timetables and schedules. I am having a problem with one specific item. First have a look at the link to the page, which will give you some idea of the layout of the table.
http://www.ontarioeastern.com/viewett.php?subdivision=Prescott
Now the problem I am having is in the field called "signal". What I want to do is to have a "rowspan" for the table data "TD", when more than one of the same type of signal is listed in order. Example
How it looks now:
4.9 Preswood CTC
7.2 Uplands CTC
12.0 Manotick CTC
20.3 Osgoode OCS
28.5 Kemptville OCS
How I want it to look:
4.9 Preswood |
---------------------|
7.2 Uplands | CTC
---------------------|
12.0 Manotick |
20.3 Osgoode |
---------------------|
28.5 Kemptville | OCS
The thing is I have absolutely no clue on how to get it to do this? Does anyone have any ideas?
Below is the source code for what I am doing.
Thanks in advance...
Phil
SOURCE CODE HERE.
<?
{
$dbquery = "select from submaster where subdivision = \"$subdivision\" and activestatus = \"active\" ";
$result = mysql_db_query($dbname,$dbquery); if(mysql_error()!=""){echo mysql_error();}
if($row = mysql_fetch_array($result))
{
$subdivisionname=$row[subdivision];
$subdivisiondescription=$row[description];
$subdivisionnotes=$row[notes];
$subdivisionmap=$row[categorypicture1];
?>
<table cellpadding=0 cellspacing=0 border=1 bordercolor=black align=center>
<tr><td colspan=3 align=left><? echo $subdivisionname ?></td></tr>
<tr><td valign=top><table cellpadding=0 cellspacing=1 border=1 bordercolor=black align=center><?
$dbquery = "select from subdivision where subdivision = \"$subdivisionname\" and activestatus = \"active\" order by mile ";
$result = mysql_db_query($dbname,$dbquery); if(mysql_error()!=""){echo mysql_error();}
while($rowstations = mysql_fetch_array($result))
{
echo "<tr><td align=center>$rowstations[mile]</td><td align=center>$rowstations[station]<br><font size=1>$rowstations[notes]</td><td align=center>";
if($rowstations[siding]!="") { echo "$rowstations[siding]"; } else { echo "-"; } echo "</td><td>$rowstations[signal]</td></tr>";
}
}
?></table>
</td>
<td valign=top><? echo $subdivisiondescription ?></td>
<td valign=top><img src="images/products/<? echo $row[categorypicture1] ?>"></td>
</tr>
</table>
<? } ?>