Hey all.
I am trying to design a menu to go across the top of a section to display information for a roster of items, based on the id number of that item.
How I want it to display is as such.
engine type - number1 number 2 number 3
engine type2 - number 1 number 2 number3 number4 number5
and so on. Engine type is a category, whereas the enginenumber is the individual number assigned.
Right now what i have is as follows... http://www.ontarioeastern.com/test/viewroster.php
It displays the engine type and engine number horizontally. I am not sure how to code it so it will display on one line, the engine type and all engine numbers associated with it, then drop to the next TR and select the next enginetype and display to it's right all associated numbers...
The source Code I am using is as follows.. any help is appreciated... thanks - Phil
Source
<?
$dbquery = "select * from engineroster order by enginetype";
$result = mysql_db_query($dbname,$dbquery); if(mysql_error()!=""){echo mysql_error();}
if(mysql_num_rows($result) > 0)
{
?><table width=600 border=0 cellpadding=0 cellspacing=0 align=center><tr bgcolor='#c6d5e1'><td>
<table width=600 border=0 cellpadding=2 cellspacing=1 align=center>
<th bgcolor='#eeeef2' height=22 align=center><font color='#000001' ><b>Engine Type</b></font></th>
<th bgcolor='#eeeef2' height=22 align=center><font color='#000001' ><b>Road Number</b></font></th>
<? while($row = mysql_fetch_array($result))
{
echo "
<tr bgcolor=#FFFFFF>
<td height=20 align=left Nowrap>
$row[enginetype]
</td>
<td height=20 align=center nowrap>
<a href='roster_modify.php?uniq_rand=".md5(uniqid(rand()))."&roadnumber=".urlencode($row[roadnumber])."'>$row[roadnumber]</a>
</td>
</tr>
";
}
?>
</table>