Showing comma separated dropdown values from column in database
<p>I have saved multiple choices from dropdown select menu into database field and separate them with comma. How can I load now them in dropdown menu again?
They are saved as: <code>choice1</code>,<code>choice2</code>,<code>choice55</code>...etc. Currently my query joining two tables and it's look's like this:</p>

<pre><code>$pdo = Database::connect();
$sql="SELECT t1.*, t2.*
    FROM form_fields t1, user_choices t2
    WHERE t1.field_name = t2.field_name
    and group_id=1 and user_id=".$_SESSION['user_id']." 

    echo '&lt;select class="form-control" name="program"&gt;';
    foreach ($pdo-&gt;query($sql) as $row_program){
            echo '&lt;option value='.$row_program['field_name'].'&gt;'.$row_program['field_name'].'&lt;/option&gt;'; 
    }
echo '&lt;/select&gt;';
</code></pre>

<p>So I need to display values from <code>user_choices t2</code> column <code>program</code>. This query showing result if there is only one value in the column. But when there is multiple value saved with comma showing error</p>

<pre><code>PHP Warning:  Invalid argument supplied for foreach()...
</code></pre>