I am doing a project in which as per number getting by GET method, I display dynamic number of HTML Textbox for storing Multiple values. I am giving each textbox unique name+id in ascending manner starting from 1(Like textbox1,textbox2). Now I want that when I click on submit button, it should fire an insert statement which insert all textbox values at once. I know I can do by array, but my question is that how to get all textbox's value in an array and How to perform insert statement?

**I have done following code:**

Here is PHP Code for submit button:

```
 $schedules = array();
    if(isset($_POST['submit']))
    {
        for($d=1; $d<=$_GET['totalDay'] ;$d++)
        {
            array_push($schedules,$_POST['txtSchedule'.'$d']);
        }
        print_r($schedules);
    }

```

Here is the html code:

```
<form method="post">
<table>
  <tr>
    <td>Day</td>
    <td>Schedule</td>
 </tr>
  <?php
  if(isset($_GET['tour_code']) and ($_GET['totalDay']!=1))
  {
    $tour_code = $_GET['tour_code'];
    $total = $_GET['totalDay'];

    $i=0;
    do
    {
      $i=$i+1;
  ?>
  <tr>
    <td><?php echo $i;?></td>
    <td>
      <input name="txtSchedule<?php echo $i;?>" type="text"  size="30"/>
    </td>
  </tr>
  <?php
      $start = date('Y-m-j',strtotime($start.'+1 days'));
  }while($i!=$total);
  }
  ?>
</table>
<input type="submit" name="submit" value="Add Tour Details" />

```

**But I am getting an empty array.**
Note: $total is coming through URLString's $GET method.

Below is the output of HTML:
![enter image description here](https://i.stack.imgur.com/iadPO.jpg)