få data fra samme række i anden kolonne, når man har fundet min.
Jeg har trukket mindste tal ud fra en kolonne, og grupperet det med navnet, men jeg skal også have datoen fra samme række, her går jeg i stå.Datoen jeg får ud er blot den nyeste.
koden er herunder, udtræk kan ses her: http://racefun.dk/klub/rf4.htm
$data = tep_db_query("SELECT rr_dato, DATE_FORMAT(rr_dato, '%d-%m%-%Y') AS rr_dato, rt_dri, min(rt_s1tid) as min_rt_s1tid, min(rt_s2tid) as min_rt_s2tid, min(rt_s3tid) as min_rt_s3tid, min(rt_s4tid) as min_rt_s4tid, min(rt_s5tid) as min_rt_s5tid, min(rt_s6tid) as min_rt_s6tid, min(rt_s7tid) as min_rt_s7tid, min(rt_s8tid) as min_rt_s8tid FROM rr JOIN rt ON rr.rr_rno=rt.rt_rno WHERE rr_klasse='Plafit' GROUP BY rt_dri");
echo "Personlige rekorder pr. spor, Plafit klassen";
echo "<table border=1 width=750 align=middle>";
echo "<tr><td align=middle>Spor 1</td>";
echo "<td align=middle>Spor 2</td>";
echo "<td align=middle>Spor 3</td>";
echo "<td align=middle>Spor 4</td>";
echo "<td align=middle>Spor 5</td>";
echo "<td align=middle>Spor 6</td>";
echo "<td align=middle>Spor 7</td>";
echo "<td align=middle>Spor 8</td></tr>";
while ($info = tep_db_fetch_array($data))
{
echo "<tr></tr><tr><td align=middle> " . $info['min_rt_s1tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s2tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s3tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s4tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s5tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s6tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s7tid'] . " </td> ";
echo "<td align=middle> " . $info['min_rt_s8tid'] . " </td></tr> ";
echo "<tr><td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td> ";
echo "<td align=middle> " . $info['rt_dri'] . " </td></tr> ";
echo "<tr><td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td> ";
echo "<td align=middle> " . $info['rr_dato'] . " </td></tr> ";
}
echo "</table>";