Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php select option selected from database

<?php

$selection = array('PHP', 'ASP');
echo '<select>
      <option value="0">Please Select Option</option>';

foreach ($selection as $selection) {
    $selected = ($options == $selection) ? "selected" : "";
    echo '<option '.$selected.' value="'.$selection.'">'.$selection.'</option>';
}

echo '</select>';
Source by www.positronx.io #
 
PREVIOUS NEXT
Tagged: #php #select #option #selected #database
ADD COMMENT
Topic
Name
7+4 =