mas saya membuat inputan dengan dropdown dibawah ini
<select name="condition4" id="condition4" style="width:70px" >
  <option value=""></option>
  <option value="Good">Good</option>
  <option value="Fail">Fail</option>
   </select>

bagaimana caranya agar inputan diatas berhasil masuk ke databasenya? terimakasih

ini script input.php
<form action="aksi_tanah_hitam.php" method="post">
<h1>TANAH HITAM</h1>
<table width="800" border="1">
  <tr>
    <td width="150" align="center">Equipment</td>
    <td align="center" width="150">Merk</td>
    <td align="center" width="150">Type</td>
    <td width="150" align="center">Serial Number</td>
    <td align="center" width="80">Condition</td>
    <td align="center" width="150">Note</td>
    <td width="100" align="center">Qty</td>
  </tr>
  <tr>
    <td> <input name="equipment" type="text" id="equipment" width="200"  /></td><!--kolom satu Equipment------------------------>
    <td><input name="merk" type="text" id="merk" width="200"  /></td><!-- Merk kolom satu ------------------->
    <td><input name="type" type="text" id="type" width="200"  /> </td><!-- Type kolom satu ------------------->
    <td><input name="serial" type="text" id="serial" width="200"  /></td><!-- Serial Number kolom satu ------------------->
     <td><select name="condition" id="condition" style="width:70px" >
  <option value=""></option>
  <option value="Good">Good</option>
  <option value="Fail">Fail</option>
   </select></td><!-- Serial Number kolom satu ------------------->
    <td><input name="note" type="text" id="note" width="200"  /></td><!-- Note kolom satu ------------------->
    <td><input name="qty" type="text" id="qty" width="200"  /></td><!-- Qty kolom satu ------------------->
  </tr>
Silahkan login untuk menjawab!
0
Loading...
ari · Dec 19, 2013 · 0 Suka · 0 Tidak Suka
<?php
$equipment=$_POST['equipment'];
$merk=$_POST['merk'];
$type=$_POST['type'];
$serial=$_POST['serial'];
$condition=$_POST['condition'];
$note=$_POST['note'];
$qty=$_POST['qty'];
//koneksi ke database
$conn = mysql_connect("localhost","root","");
mysql_select_db("databasenya");
mysql_query("INSERT INTO tbl_tanah_hitam (equipment,merk,type,serial,condition,note,qty) VALUES('$equipment','$merk','$type','$serial','$condition','$note','$qty')") or die ("data gagal masuk ke databasenya!");
?>