php - to retrive data from database to bind with combobox -


script contains function increment row element defined in html

      <script language="javascript">       function addrow(tableid) {         var rownumber = document.getelementbyid('rownumber');         rownumber.value = parseint( rownumber.value ) + 1;          }         </script> 

table consist of row generated automatically clicking add button .

i want use value of p_name[] , make[] retrive data database bind combobox model[]

error obtained :- notice: undefined variable: make in c:\xampp\htdocs\phpproject1\transaction1.php on line 117

notice: undefined variable: p_name in c:\xampp\htdocs\phpproject1\transaction1.php on line 117

         <table id="datatable"  border="1" cellspacing="10">          <input id="rownumber" type="hidden" name="row" value="1"/>          <tr>          <td> 1 </td>          <td><select name="p_name[]" class="input_text">                 <option value="camera">camera</option>                     <option value="dvr">dvr</option>                      <option value="ps">power supply</option>                       <option value="hd">hard disk</option>                        <option value="wire">wire</option>                </select>          </td>          <td> <select name="make[]" class="input_text">                   <option value="electronic eye">electronic eye</option>                      <option value="viewmax">viewmax</option>                      <option value="hikvision">hikvision</option>                      <option value="sony">sony</option>                </select></td>               <td> <?php                 $con = mysqli_connect('localhost','root','','danisco');                      if (mysqli_connect_errno($con))                      {                        echo "failed connect mysql: " . mysqli_connect_error();                          }                    else  {                $query = mysqli_query($con, "select p_model product p_make = '$make' , p_name = '$p_name' " );                 echo '<select name="model[]" class="input_text">';                     while ($row = mysqli_fetch_array($query))                         {                              echo '                                 <option value="'.$row['p_model'].'">'.$row['p_model'].'</option>                                  ';                     }                   }              ?>              </td>          <td> <input name="qty[]"type="text" /> </td>         <td> <input name="sno[]"type="text" /> </td>            </tr>         </table>         <center><input type="button" value="add row" onclick="addrow('datatable');"/>  </center>         <label><span><b>delivery boy</b></span><input name="d_boy" class="input_text" type="text" size="20" />           <br><input type="submit" id="button1"/> 

you have use j-query post function , withe php in different file. impossible retrieve value of make , product.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -