index.php coding
<td><input type="text" name="slno[]" value="" size="2"></td>
<td><input type="text" size="10" name="date[]" id="SelectedDate" onClick="GetDate(this);" readonly="readonly"/></td>
<td><input size="24" type="text" name="particulars[]" value="" placeholder="Description"></td>
<td><select name="noofnights[]" value="0">
<option value="empty"></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<input size="14" type="text" onKeyUp="return valtxt(this)" name="rate[]" value="0">
<input size="14" type="text" name="price[]" value="0" readonly="readonly">
<input size="9" type="text" name="tax[]" onKeyUp="return valtxt(this)" value="0">
<input size="1" type="hidden" name="taxtotal[]" value="0" readonly="readonly"></td>
store.php coding
if (isset($_POST['submit_val']))
{
foreach ( $_POST['slno'] as $key=>$slno )
{
$date = $_POST['date'][$key];
$particulars = $_POST['particulars'][$key];
$c_date = mysql_real_escape_string($date);
$c_slno = mysql_real_escape_string($slno);
$tariff = mysql_query("INSERT INTO ebvouchertariffs ( TariffSlNo, TariffDate)", $link );
}
}
here i stored some values to mysql db using an array. i used dynamic rows so i used an array for store the values into database. now i want to fetch the values from mysql db. how can i do that using foreach?? in this database table i assigned one id from another table. for example if i inserted 5 rows into the table i assigned specific id from another table for these 5 rows. so i want to use that specific id and then fetch the 5 rows values. i tried but i cannot able to get 5 rows. first row value only fetched....