array

haniva · Nov 14, 2014
master, mau nanya gimana coding cara nyimpan data ke tabel yang datanya disimpan banyak sekaligus

cobtohnya
<table width="100%" border="1">
            <tr>
              <td>&nbsp;</td>
              <td><input type="submit" name="Submit" value="Submit" /></td>
            </tr>
            <tr>
              <td width="4%"><div align="center"><strong>No</strong></div></td>
              <td width="65%"><div align="center"><strong>Pertanyaan</strong></div></td>
              <td width="31%"><div align="center"><strong>Jawaban</strong></div></td>
            </tr>
            <?php
							$no=1;
                $tampill = mysql_query("SELECT * FROM kuesioneralumni");
            while ($data = mysql_fetch_array($tampill)) {
			$idp=$data['idpertanyaanka'];
                ?>
            <tr>
              <td><?php echo $no; ?></td>
              <td><input name="idpertanyaan" type="hidden" value="<?php echo $no; ?>" />
                  <?php echo $data[pertanyaanka]; ?></td><input name="pertanyaan_id[]" type="hidden" value="<?php echo $data[pertanyaanka]; ?>" />
				  <input name="jawaban_id[]" type="hidden" value="<?php echo $data[idjawabaka]; ?>" />
				  <input name="nobp[]" type="hidden" value="<?php echo $data[nobp]; ?>" />
              <td><label>
                <select name="jawab[]" id="jawab">
                  <?php
                                $tampil = mysql_query("SELECT jawaban FROM jawabka where idpertanyaanka = '$idp' ORDER BY idpertanyaanka");
                                while ($r = mysql_fetch_array($tampil)) {
                                    echo "<option value=$r[idjawabka]>$r[jawaban]</option>";
                                }
                                ?>
                </select>
              </label></td>
            </tr>
			<?php
            }
            break;
            ?>
          </table>
bagaimana cara penyimpanannya itu master? ah saya juga bingung cara menjelaskannya
Silahkan login untuk menjawab!