php - Get the value of the changed select in table -
i need values of selected select orderno of changed row
the table looks
if change order no 1002 sold
$query = mysql_query("select * orders"); while($row = mysql_fetch_assoc($query)) { echo '<tr>'; echo '<td>'.$row['orderno'].'</td>'; echo '<td>'.$row['total'].'</td>'; echo '<td>'; if($row['status'] == "sold") { echo '<select name = "status[]">'; echo '<option value = "sold" selected>sold</option>'; echo '<option value = "cancelled">cancelled</option>'; echo '</select>'; } else { echo '<select name = "status[]">'; echo '<option value = "sold">sold</option>'; echo '<option value = "cancelled" selected>cancelled</option>'; echo '</select>'; } echo '</td> echo </tr>'; } if(isset($_post['status'])) { //sample echo "you change orderno ".$orderno_here." total of ".$total_of_order." ".$selected_status_of_orderno_here; }
there many records in table , selects same
how values of selected select
following question, whatever understood, according supposing getting data form tags in page. if case, know value changed reflected in db. can selected select this. can check change through code:
if(isset($_post['element'])){ //if block executed, <element> named element changed }
ignore answer if not case using in code..
Comments
Post a Comment