Here is a simple example illustrating my problem:
I have two tables in my MySQL database
Table1
[table]
[tr]
[td]Name[/td]
[td]Number[/td]
[/tr]
[tr]
[td]Jane[/td]
[td]4 [/td]
[/tr]
[tr]
[td]Mark[/td]
[td]6 [/td]
[/tr]
[tr]
[td]Jane[/td]
[td]3[/td]
[/tr]
[tr]
[td]Sara[/td]
[td]7 [/td]
[/tr]
[tr]
[td]Jane[/td]
[td]6[/td]
[/tr]
[tr]
[td]Mark[/td]
[td]2[/td]
[/tr]
[/table]
I want to make summary for each person, and present the result in a new table, like this:
Table2
[table]
[tr]
[td]Name[/td]
[td]Sum[/td]
[/tr]
[tr]
[td]Jane[/td]
[td]13[/td]
[/tr]
[tr]
[td]Mark[/td]
[td]8[/td]
[/tr]
[tr]
[td]Sara[/td]
[td]7[/td]
[/tr]
[/table]
How can I make a php/MySQL routine for this?