example... http://www.e-ponies.com/races/california-free-horse-racing-picks.htm

Just an example of what this would look like below..

SELECT t1.Horse, t1.Track, t1.Race, t2.Speed, t2.Class, t2.Form, t2.Last, t2.Conn, t2.Line, t2.win, t2.Total FROM racestoday as t1 LEFT JOIN horses as t2 ON t1.HorseRef = t2.HorseRef WHERE t1.Date = CURDATE() ORDER BY t1.Date ASC, t1.track ASC, t1.Race ASC

It would list them perfectly liek the example link above.. but how do you get all the highest in bold??.. and how they bold each race for each track and Speed, Class, Form,Conn, and Total? Is this Group by? when I try group by I only get one row from track race 1, track race 2, track race 3.. but how do you get all?

Any help would be great! Each Track by Each race with "all" horses listed and just ONE example of how to bold the highest in a list. Not order, but highlight or bold.

Am I going in the wrong direction here with mysql? is it in php coding?? or mysql or both??

Thanks for any replies.

    I might be inclined to do 2 queries: one to get the ordered list of rows, and the other to get the max values for columns of interest (using MAX() and GROUP BY). Then when you output a row from the first query, you would check to see if one of those values matches the max for that column, and if so, make it bold (via a CSS-styled class or simply marking in <strong>).

    <td><?php 
    echo ($row['col_name'] == $max['col_name']) 
        ? "<strong>{$row['col_name']}</strong>"
        : $row['col_name'];
    ?></td>
    

    (Or any of a dozen or so other ways of outputting that 😉 )

      Write a Reply...