Code: Select all
$result = mysql_query ("SELECT * FROM diary WHERE raceid = '$id' ORDER BY cartype ASC");
while ($row = mysql_fetch_object($result))
{
$resultuser = mysql_query ("SELECT * FROM admin WHERE id = '$row->userid'");
while ($rowuser = mysql_fetch_object($resultuser))
{
echo "<tr valign='top'>
<td>$rowuser->firstname $rowuser->lastname</td>
<td>$row->carmake, $row->carmodel</td>
<td>$row->cartype</td>
<td>$row->transponder</td>
<td>$row->frequency</td>
<td>";
if ($cookietype == "admin") { echo "<a href='index.php?page=attendees&id=$id&diaryid$row->id&event=$event&=&d=yes' style='text-decoration: none; color: #444444'>Admin Delete</a><br/>";}
if ($cookieid == "$row->userid") { echo "<a href='index.php?page=attendees&id=$id&diaryid$row->id&event=$event&=&d=yes' style='text-decoration: none; color: #444444'>Delete</a>";}
echo "</td></tr>";
}
mysql_free_result($resultuser);
} mysql_free_result($result);Is it possible to put a blank spaced row when one car type ends, and another begins.
Ie. you have three '2WD' and then you have two'4WD'.
Can it show like this?
Fred 2WD
Bob 2WD
Ginger 2WD
Arthur 4WD
Alf 4WD
???
I would assume it checks the word being rendered and if the next one in the query is different from the one before, then put in a space, but I cannot work it out.
I tried this:
Code: Select all
$cartype=$row->cartype
if ($cartype != $cartype) { echo "stick in a space";}
Help!!