mysql - PHP-HTML5-Form - My query-generated dropdown posts a blank value -


when load page, value of variable, $v_updateone, "select version". when select version, value goes blank. need grab selected value use in db update statement. thank assistance. -james

<form method="post" action="update.php" width="50"> <?php  $avquery = "select $v_software1 version_master.vermas_availableversions $v_software1 not null order sortcol desc";   $a_availvers = mysql_query($avquery);   #_version dropdown box   echo "<select name='availversone' onchange=submit()>";   echo "<option>select version</option>";   while ($row = mysql_fetch_array($a_availvers)) {     echo "<option value='" . $row['$v_software1'] . "'>" . $row[$v_software1] . "</option>";   }  echo "</select>";   $v_updateone = $_post['availversone'];  echo $v_updateone;  ?> </form> 

you have error in

value='" . $row['$v_software1'] . "' 

since $v_software1 in single quotes, literal $v_software1.

try removing quotes -

value='" . $row[$v_software1] . "' 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -