Tuesday, May 8, 2012

PHP - Dropdown contains all value from mysql


<?php
require('db/db_open.php');
$row = mysql_query("SELECT * FROM quiz_lcd where datesent = CURDATE()");

 // Insert value from radio button value into mysql
while($ib_row = mysql_fetch_array($row))
{
echo "<option value=\"1\" >" . $ib_row['option1'] . "</option>";
echo "<option value=\"2\" >" . $ib_row['option2'] . "</option>";
echo "<option value=\"3\" >" . $ib_row['option3'] . "</option>";
echo "<option value=\"4\" >" . $ib_row['option4'] . "</option>";

}
?>

No comments:

Post a Comment