This is my update.php codes. I already checked others php file and found no problem. This codes have no error but it cant updating data in database.
require_once "conn.php";
$conn=connect();
$db=connectdb();
$id= "";
$parcelno = "";
$items = "";
if(isset($_REQUEST['id'])){ $id= $_REQUEST['id']; }
if(isset($_REQUEST['parcel'])){ $parcel = $_REQUEST['parcel']; }
if(isset($_REQUEST['items'])){ $items = $_REQUEST['items']; }
mysql_select_db($db,$conn) or die (mysql_error()."\n");
$sql="UPDATE parcel SET parcelno='$parcelno', items='$items' where id='$id'";
$result=@mysql_query($sql) or die(mysql_error()."\n");
This is edit.php code which used for update form :
<?php
$ic = $_REQUEST["ic"];
require_once "conn.php";
$conn = connect();
$db = connectdb();
mysqli_select_db($conn,$db) or die (mysqli_error($conn)."\n");
$query_usr = "select * from parcel";
$usr = mysqli_query($conn,$query_usr) or die (mysqli_error($conn)."\n".$query_usr);
$row_usr = mysqli_fetch_assoc($usr);
?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background-color: #CCC;
}
</style>
</head><body><center><p><a href="adminselect.php"><img src="image/header.png" width="800" height="200"></a></p></center>
<form action="update.php" method="get">
<?php
$sql = "SELECT * FROM parcel where ic = $ic";
$result1 = mysqli_query($conn,$sql);
while ($row=mysqli_fetch_assoc($result1)){
?>
<center><table border="0">
<tr>
<td colspan="3" bgcolor="#0066FF"><strong><center>Update Registration </strong></td>
</tr>
</tr>
<tr>
<td bgcolor="#0099FF">Parcel Number</td>
<td>:</td>
<td bgcolor="#FFFFFF"><input name="parcelno" type="text" id="parcelno" value="<?php echo $row["parcelno"];?>" size="50"></td>
</tr>
<tr>
<td bgcolor="#0099FF">Items</td>
<td>:</td>
<td colspan="2" bgcolor="#FFFFFF">
<p>
<label for="select"></label>
<select name="items" size="1" id="items">
<option><?php echo $row["items"];?></option>
<option>Pos Laju</option>
<option>Pos Ekspress</option>
<option>Skynet</option>
<option>GDEX</option>
<option>Nationwide Express</option>
<option>FedEx</option>
<option>UPS</option>
</select>
</p></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td colspan="2" bgcolor="#CCCCCC"> <input name="" type="submit" value="Update"></td>
</tr>
<?php }?>
</table></center>
</form></body></html>
I researched this problem almost half a day and nothing works :/