Question: I am writing an application which shows a user one thing to vote on, at a time. I have a MySQL table which contains these things. Right now I have it set up so that upon login, I query my database to get a limited number of these things, and then I use PHP to turn that into an array. After a user submits a vote, the thing they've already voted on is 'unset' from the array. When the new array size is one, I query my database to create a new array. 
Is this a 'bad' way to do it? Should I instead just query my database to get a new thing for the user to vote on after every time they submit a vote?

Any help/suggestions appreciated.

Answer: 
You add value the same way as when you read a value: By using its key(s)

```
$array_in_this_question[0]['avatar'] = md5($array_in_this_question[0]['user_email']);

```
Simply make

```
$array[0]['avatar'] = $avatar

```