You would also need a JavaScript function to add new elements incrementing a hidden variable as the counter.
The database structure would most likely use a new table for 'friends' or something similar so you can have multiple rows rather than using the same table and adding additional columns.