<?php $sql="select * from tb_transport"; $query=mysql_query($sql); while($row=mysql_fetch_array($query)) { ?> <input type="checkbox" name="transport[]" value="<?php echo $row["id"];?>"><?php echo $row["name"];?><input type="text" name="dsec[]" value="">Daily<br> <?php } ?> <input type="submit" name="submit" value="submit"> </form>
if(isset($_POST["submit"])) { for($i=0;$i<count($_POST["transport"]); $i++) { $transport=$_POST["transport"][$i]; $dsec=$_POST["dsec"][$i]; mysql_query("insert into transport_two set transport_id='$transport',name='$dsec'"); } } ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)