Question: i have this on my database table

id\_a | nama | email |

1 | philipe | philipe@mail.com |

2 | dora | dora@mail.com |

3 | John | john@mail.com |

this code on my view

```
<tr>
<td><label for="cities">Select attendances</label></td>
<td> : </td>
<td>    <select class="multiselect" multiple="multiple" name="id_c[]" title="click to select Attendances">
    <?php foreach ($test as $data): ?>
    <option value="<?php echo $data->id_a ?>" ><?php echo $data->nama ?></option>
    <?php endforeach; ?>
    </select></td></tr>

```

in my code i have option value from my database = 1 2 3

what i want to do is send email, with an email address from my database

```
$id_c = $this->input->post('id_c');
        foreach($id_c as $id_a)
        {
        $query="SELECT email From mstr_attend WHERE id_a = ".$id_a.""; }

```

and here's the problem  

what i get from this code is philipe@mail.comdora@mail.comjohn@mail.com

what i need is philipe@mail.com, dora@mail.com, john@mail.com

a comma after one email
can someone,give me some solution so i can get that

Answer: 
The issue is that `writable` and `set`/`get` are mutually exclusive. The code generates this helpful error in Chrome:

```
Invalid property. A property cannot both have accessors and be writable...

```

This makes some logical sense: if you have `set`/`get` accessors on a property, that property is never going to be written to and/or read from, because any attempts to read/write it will be intercepted by the accessor functions. If you define a property as `writable` *and* give it accessor functions, you are simultaneously saying:

1. "The value of this property can be directly altered," and
2. "Block all attempts to read and/or write to this property; instead, use these functions."

The error is simply stopping you from specifying a contradiction. I assume from the fact that you wrote a getter and setter, you don't really want the property to be `writable`. Just remove that line, and your code runs perfectly.
Late answer, not looking for votes, but hoping this will be helpful.

There are two kinds of properties. Each property is EITHER:

1. a **data property** which has these four attributes:

	* value
	* writable
	* enumerable
	* configurable
2. OR an **accessor property** which has these four attributes:

	* get
	* set
	* enumerable
	* configurable

Therefore there is no property that can have both `get` and `writable`. That's just the way JavaScript is! Please see section 8.6 of the [ECMAScript Standard](http://www.ecma-international.org/ecma-262/5.1/Ecma-262.pdf) for the gory details.