![]() Topic awaiting preservation: MySQL Table output (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: :morF |
![]() Ok guys...here's the scoop. While I'm off in the land of the faeries, I've been working on some PHP/MySQL projects, and one of them requires me to output a table from my database in a certain way. The systme itself will partially be used to book pieces of equipment for certain times of the day, and also to show the times when equipment isn't booked. The table will basically list all the pieces of equipment down the side (The 'equip' field in the table) and then listed the periods of the day accross the top. I know that I can get PHP to echo out the fields with data in them, but I also need to it echo out the fields with nothing in them. If the fields don't have anything in them, it will need to display a 1x1 transparent GIF and stretch it to fit the table. This way, when the table's displayed the user can click on the empty fields in order to book them. |
Maniac (V) Inmate From: under the bed |
![]() Well, when you make your query, and use (presumably) mysql_fetch_array() to get your results into PHP, set a variable for each field. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() be warned, when you use mysql_fetch_array, and a field in the current row is null, it won't be set in the array. |