- Beranda
- Komunitas
- Tech
- Computer Stuff
[ASK/WTA] Mohon Pencerahan Update PHP Ga Berfungsi
TS
reka1305
[ASK/WTA] Mohon Pencerahan Update PHP Ga Berfungsi
ini kodingnya gan
<HTML>
<body BGCOLOR="#FF0066">
<center>
</br>
<Body>
<form action="update_tiket.php" method="post">
<input type="hidden" name="hidden" />
NAMA PELANGGAN : <input type="text" name="NAMA_PELANGGAN" />
TUJUAN</TD> <TD> : </TD> <TD> <SELECT NAME="TUJUAN">
<OPTION>BANDUNG
<OPTION>SURABAYA
<OPTION>BALI
</SELECT>  
JUMLAH TIKET : <input type="text" name="JUMLAH_TIKET" />
STATUS </TD> <TD> : </TD> <TD>
<INPUT TYPE="radio" NAME="STATUS" VALUE="MEMBER" CHECKED>MEMBER
<INPUT TYPE="radio" NAME="STATUS" VALUE="NON MEMBER" CHECKED>NON MEMBER<BR> </TD>
<input type="submit" value="UPDATE" />
</form>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mrg", $con);
mysql_query("UPDATE tiket SET NAMA PELANGGAN = '$_POST[NAMA_PELANGGAN]'
WHERE NO_ID = '$_POST[NAMA_PELANGGAN]'");
mysql_query("UPDATE tiket SET TUJUAN = '$_POST[TUJUAN]'
WHERE TUJUAN = '$_POST[TUJUAN]'");
mysql_query("UPDATE tiket SET JUMLAH_TIKET = '$_POST[JUMLAH_TIKET]'
WHERE JUMLAH_TIKET = '$_POST[JUMLAH_TIKET]'");
mysql_query("UPDATE tiket SET STATUS = '$_POST[STATUS]'
WHERE STATUS= '$_POST[STATUS]'");
mysql_close($con);
?>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mrg", $con);
$result = mysql_query("SELECT * FROM tiket");
echo "<center>";
echo "<table cellpadding='5' cellspacing='8'>";
echo "
<tr bgcolor='purple'>
<th>NO_ID</th>
<th>NAMA_PELANGGAN</th>
<th>TUJUAN</th>
<th>JUMLAH_TIKET</th>
<th>STATUS</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" ; echo $row['NO_ID'] ; "</td>";
echo "<td>" ; echo $row['NAMA_PELANGGAN'] ; "</td>";
echo "<td>" ; echo $row['TUJUAN'] ; "</td>";
echo "<td>" ; echo $row['JUMLAH_TIKET'] ; "</td>";
echo "<td>" ; echo $row['STATUS'] ; "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<a href="delete_tiket.php"> Form Delete </a>
<a href="quis_tiket.php"> Form Insert | </a>
<a href="cari.php"> Form Cari Data </a>
</body>
</html>
Mohon Bantuanya Ya Thanks Before
<HTML>
<body BGCOLOR="#FF0066">
<center>
</br>
<Body>
<form action="update_tiket.php" method="post">
<input type="hidden" name="hidden" />
NAMA PELANGGAN : <input type="text" name="NAMA_PELANGGAN" />
TUJUAN</TD> <TD> : </TD> <TD> <SELECT NAME="TUJUAN">
<OPTION>BANDUNG
<OPTION>SURABAYA
<OPTION>BALI
</SELECT>  
JUMLAH TIKET : <input type="text" name="JUMLAH_TIKET" />
STATUS </TD> <TD> : </TD> <TD>
<INPUT TYPE="radio" NAME="STATUS" VALUE="MEMBER" CHECKED>MEMBER
<INPUT TYPE="radio" NAME="STATUS" VALUE="NON MEMBER" CHECKED>NON MEMBER<BR> </TD>
<input type="submit" value="UPDATE" />
</form>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mrg", $con);
mysql_query("UPDATE tiket SET NAMA PELANGGAN = '$_POST[NAMA_PELANGGAN]'
WHERE NO_ID = '$_POST[NAMA_PELANGGAN]'");
mysql_query("UPDATE tiket SET TUJUAN = '$_POST[TUJUAN]'
WHERE TUJUAN = '$_POST[TUJUAN]'");
mysql_query("UPDATE tiket SET JUMLAH_TIKET = '$_POST[JUMLAH_TIKET]'
WHERE JUMLAH_TIKET = '$_POST[JUMLAH_TIKET]'");
mysql_query("UPDATE tiket SET STATUS = '$_POST[STATUS]'
WHERE STATUS= '$_POST[STATUS]'");
mysql_close($con);
?>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mrg", $con);
$result = mysql_query("SELECT * FROM tiket");
echo "<center>";
echo "<table cellpadding='5' cellspacing='8'>";
echo "
<tr bgcolor='purple'>
<th>NO_ID</th>
<th>NAMA_PELANGGAN</th>
<th>TUJUAN</th>
<th>JUMLAH_TIKET</th>
<th>STATUS</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" ; echo $row['NO_ID'] ; "</td>";
echo "<td>" ; echo $row['NAMA_PELANGGAN'] ; "</td>";
echo "<td>" ; echo $row['TUJUAN'] ; "</td>";
echo "<td>" ; echo $row['JUMLAH_TIKET'] ; "</td>";
echo "<td>" ; echo $row['STATUS'] ; "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<a href="delete_tiket.php"> Form Delete </a>
<a href="quis_tiket.php"> Form Insert | </a>
<a href="cari.php"> Form Cari Data </a>
</body>
</html>
Mohon Bantuanya Ya Thanks Before
0
896
2
Komentar yang asik ya
Urutan
Terbaru
Terlama
Komentar yang asik ya
Komunitas Pilihan