Hello,
I am trying to update my record but nothing is happening please help me out
update.php
<?php
require_once("connection.php");
if(isset($_POST["update"])) {
$uid = $_POST["uid"];
$user_name = $_POST["uname"];
$f_name = $_POST["fname"];
$l_name = $_POST["lname"];
$company = $_POST["company"];
$address = $_POST["address"];
$phone = $_POST["phone"];
$fax = $_POST["fax"];
$mobile = $_POST["mobile"];
$email = $_POST["email"];
$query_update = "UPDATE users SET user_name = {$user_name}, f_name = {$f_name}, l_name = {$l_name}, company = {$company}, phone = {$phone}, fax = {$fax}, mobile = {$mobile}, email = {$email} WHERE u_id = ".$uid;
$query_confirm = mysqli_query($connection, $query_update);
if($query_confirm) {
header("Location:../profile.php");
} else {
header("Location:../profile_edit.php?uid=" . $uid);
}
}
?>
editrecord
<form method="POST" action="includes/update_profile.php">
<div class="info">
<input type="hidden" name="uid" value="<?php echo $user_id; ?>" />
<label>
<p class="info_staic">Username</p>
<p class="info_dynamic"><input type="text" class="field" name="uname" value="<?php echo $user_name; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Company Name</p>
<p class="info_dynamic"><input type="text" class="field" name="coname" value="<?php echo $company; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Firts Name</p>
<p class="info_dynamic"><input type="text" class="field" name="fname" value="<?php echo $f_name; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Last Name</p>
<p class="info_dynamic"><input type="text" class="field" name="lname" value="<?php echo $l_name; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Address</p>
<p class="info_dynamic"><input type="text" class="field" name="address" value="<?php echo $address; ?>" /></p>
<div class="clear"></div>
</label>
</div><!-- End of content left-->
<div class="info">
<label>
<p class="info_staic">Phone</p>
<p class="info_dynamic"><input type="text" class="field" name="phone" value="<?php echo $phone; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Fax</p>
<p class="info_dynamic"><input type="text" class="field" name="fax" value="<?php echo $fax; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Mobile</p>
<p class="info_dynamic"><input type="text" class="field" name="mobile" value="<?php echo $mobile; ?>" /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Email</p>
<p class="info_dynamic"><input type="text" class="field" name="email" value="<?php echo $email; ?>" /></p>
<div class="clear"></div>
</label>
<input type="submit" class="btn" value="update" name="update" />
</div><!-- End of content right-->
</form>