Now it’s all crystal clear on what you are trying to do. It really helps to have the full code and a screen shot to go along with it.
I’m assuming the ID field is a numeric column of some kind in the database. After it updates the table I’m not sure what you want it to do, looks like you got a piece of it commented out.
So it should just reload the updated information.
[php] <?php
session_start();
if(isset($_SESSION[‘user’]) && !empty($_SESSION[‘user’])){
echo "Welcome ". $_SESSION[‘user’];
//include 'tabmenuOneForAll.php';
?>
<?php include 'config.php'; mysql_connect($server,$db_user,$db_pass); if (isset($_POST['upload'])) { $user_id = $_POST['user_id']; $company_address = $_POST['company_address']; $tel = $_POST['tel']; $mobile = $_POST['mobile']; $incharge = $_POST['incharge']; $email = $_POST['email']; $update = "UPDATE customer SET company_address = '{$company_address}', tel = '{$tel}', mobile = '{$mobile}', incharge = '{$incharge}', email = '{$email}' WHERE id = {$user_id}"; $result_update = mysql_query($update); echo $result_update; //header("Location: edit_client.php?update=".$result_update.""); //var_dump($result_update); exit; //echo "Files updated
"; //setting $id to the user that was just updated. $id = $user_id } else $id = $_GET['id']; } $query = "SELECT * FROM customer WHERE id = {$id}"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); //header("Location: edit_client.php?update=".$result.""); //header("Location: view_client.php"); ?>
id : | |
Customer ID : | |
Name : | |
Address: | |
Phone Number: | |
Mobile: | |
Person In Charge: | |
E-mail: |