Answers for "shtml select and echo php"

PHP
0

php echo selected option

<select name="s" size="20">
  <option value="402" <?php if ($_GET['s'] == '402') { echo 'selected'; } ?>>Audi</option>
  <option value="74" <?php if ($_GET['s'] == '74') { echo 'selected'; } ?>>BMW</option>
  <option value="201" <?php if ($_GET['s'] == '201') { echo 'selected'; } ?>>Ford</option>
  <option value="35" <?php if ($_GET['s'] == '35') { echo 'selected'; } ?>>Saab</option>
</select>
Posted by: Guest on May-03-2021
-1

print select mysql in php

// Process all rows
while($row = mysql_fetch_array($result)) {
    echo $row['column_name']; // Print a single column data
    echo print_r($row);       // Print the entire row data
}
Posted by: Guest on December-30-2021

Browse Popular Code Answers by Language