First : learn some SQL
Second : design a database
Third : design PHP to insert values into your database.
To be honest you're being a bit vague. How is the datarepresented at the current time? How do you get your data at the present time? How did you get the initial data? Is there are database system available to you? Do you have to design one from scratch?