单击提交后从一行获取整个数据

时间:2013-12-02 17:45:38

标签: php html-table

我想从下表中获取一行的所有数据,但我无法得到简单的方法,因为我放了复选框,还有下拉列表。单击添加后,我很困惑如何从该行获取所有数据。请帮忙。

$result1 = mysql_query("SELECT * FROM  dis_lecturer WHERE status = 'Lecturer' ORDER BY lecturer_name ASC") or die(mysql_error());


  echo "<br><br>Lecturer that are not Supervisor yet.<br>";
  echo "<form action='assignsuper.php' method=post>";
  echo"<p align= 'center'><table cellspacing='2' cellpadding='5' border='1'>";
  echo"<tr><th  bgcolor=#D8D8D8>ID</th><th  bgcolor=#D8D8D8>NAME</th>
   <th  bgcolor=#D8D8D8>SEMESTER</th>

          <th  bgcolor=#D8D8D8> MAX STUDENT
          </th>
          <th  bgcolor=#D8D8D8> SECTION
          </th>

          <th  bgcolor=#D8D8D8>ASSIGN</th>
          </tr>";


  while ($row = mysql_fetch_array($result1, MYSQL_NUM)) {


echo "<tr><td>".$row['0']."</td><td>".$row['1']."</td><td".$row['2']."</td>
 <td>
              <input type='checkbox' name='sem' value='Sem 1'> Sem 1<br>
             <input type='checkbox' name='sem' value='Sem 2'> Sem 2 <br>
             <input type='checkbox' name='sem' value='Sem 3'> Sem 3<br></td>

          <td><select name='total'>
                  <option value='' selected> ----</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>
                  </select>
          </td>
          <td><select name='section'>
                  <option value='' selected> ----</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>
                  </select>
          </td>

          <td><input type='submit' name= 'hit' value ='ADD'></td>
          </tr>";





    echo "</form>";
}    echo"</table>" ;

0 个答案:

没有答案