Explaination:
In this above coding we have to update all fields we have to write for($i=0;$i<sizeof($_POST['tid']);$i++) for conditions.And we have to update the Status for the fields.
In this above coding we have to update all fields we have to write for($i=0;$i<sizeof($_POST['tid']);$i++) for conditions.And we have to update the Status for the fields.
Form:
<form method="post" name="form"> <td align="center"><?php echo $id;?><input type="hidden" name="tid[]"
value="<?php echo $id;?>"/></td> <td align="center"><input type="text" name="total_bookedseats[]"
value="<?php echo $total_bookedseats;?>" style="width:120px;"/></td> </tr> <?php }?> <tr align="center"><td align="center" colspan='10'>
<input type="submit" value="Update" name="update" class="signin_butonstyle"/>
</td></tr> </form>
PHP Update Coding:
<?php if(isset($_POST['update'])) { for($i=0;$i<sizeof($_POST['tid']);$i++) { //POST all fields $total_bookedseats=$_POST['total_bookedseats'][$i]; if($total_noof_seats!=0) { $status="Available"; } else { $status="Soldout"; } $update=mysql_query("update ticket_details SET
ticket_type='$ticket_type',
unit_price='$unit_price',
service_charge='$service_charge',
total_noof_seats='$total_noof_seats',
total_bookedseats='$total_bookedseats' where tid= '".$_POST[tid][$i]."' "); } } ?>
No comments:
Post a Comment