[prog] mysql, php, arrays

Saint-Wolfe wolf at wolfrising.net
Tue Oct 14 01:22:46 EST 2003


I have a select statement that produces these results

mysql>  select s_code, term, year, c_code, dayname(date), status from 
attendance where s_code=193586498 and term='fall' and year=2003 and 
date between '2003-09-01'and '2003-09-05';
+-----------+------+------+--------+---------------+---------------+
| s_code    | term | year | c_code | dayname(date) | status        |
+-----------+------+------+--------+---------------+---------------+
| 193586498 | Fall | 2003 | cp105  | Tuesday       | in attendance |
| 193586498 | Fall | 2003 | cp105  | Wednesday     | in attendance |
| 193586498 | Fall | 2003 | cp105  | Thursday      | in attendance |
| 193586498 | Fall | 2003 | cp105  | Friday        | in attendance |
| 193586498 | Fall | 2003 | GE119  | Tuesday       | in attendance |
| 193586498 | Fall | 2003 | GE119  | Thursday      | in attendance |
| 193586498 | Fall | 2003 | HI200  | Tuesday       | in attendance |
| 193586498 | Fall | 2003 | HI200  | Wednesday     | in attendance |
| 193586498 | Fall | 2003 | HI200  | Thursday      | in attendance |
| 193586498 | Fall | 2003 | HI200  | Friday        | in attendance |
| 193586498 | Fall | 2003 | WP207  | Wednesday     | in attendance |
| 193586498 | Fall | 2003 | WP207  | Thursday      | in attendance |
| 193586498 | Fall | 2003 | WP207  | Friday        | in attendance |
+-----------+------+------+--------+---------------+---------------+
13 rows in set (0.14 sec)

I need to get this into a table that looks  something like this
+-----------+------+------+--------+---------------+---------------+

MWF-TuTh | mon  | tues | wed    | thur           | fri
+-----------+------+------+--------+---------------+---------------+
8am                      in attendance                        in 
attendance


and so on and so forth, I'm thinking it requires an array of some sort 
perhaps?
any help would be appreciated, it's the last thing I have to finish to 
escape this project : )
I think I have exhausted all dreamweaver use for php, but it does help 
with the
small stuff : )

Thank you : )



More information about the Programming mailing list