views:

17

answers:

2

I have a table about a program guide with 4 columns: idguide, idday, starthour, program. I would like to present it on the screen per day. Must i call 7 times its recordset, like this SELECT * FROM tblguide WHERE idday = 1 ORDER BY start ASC

This works but causes bigger workload; is there another solution where i only have one recordset and filter the idday during the presentation ? SELECT * FROM tblguide ORDER BY start ASC

I don't know which solution ? Arrays i'm not so familiar with. Thanks for helping me !

A: 

Don't you mean

SELECT * FROM tblguide ORDER BY idday, start;

and do the rest while retrieving?

Edit:

$oldday = null;
while($r = mysql_fetch_assoc($whatever)) {
    if($oldday!=$r['idday']) {
        // It's a new day!
        $oldday = $r['idday'];
    }
    // whatever
}
Michael Krelin - hacker
A: 

Yes. But i was wondering how to retrieve the results later in my page, filterign on idday ?

DaveL
You should've added comment, not the answer. I updated my answer,anyway.
Michael Krelin - hacker