mardi 19 janvier 2016

how to crate a dynamic html table with php and sql database

i want to make a dynamic html table that would display data from my database. My database table looks like this:

 | name   | allowances | amount |
 |  jim   |   meal     |   900  |
 |  jim   |   fare     |   700  |
 |  alan  |   load     |   500  |
 | sohpie |   meal     |   900  |
 | sohpie |   load     |   500  |

I need my html table to display this:

 | name   | meal  | load | fare |
 |  jim   |  900  |   0  |  700 |
 |  alan  |   0   |  500 |   0  |
 | sohpie |  900  |  500 |  900 |

my problem is how i am going to output the amount as <td> aligned with the allowances as <th>. please help! thank you.




Aucun commentaire:

Enregistrer un commentaire