ok, i think you misunderstand it…
i screenshot the step of my whole process along with the codes.
first, is viewing all the client list which is call view_client.php

[php]<?php
session_start();
if(isset($_SESSION[‘user’]) && !empty($_SESSION[‘user’])){
echo "You are Welcome ". $_SESSION[‘user’];
?>
ID |
Company Name |
Address |
Tel |
E-mail |
Phone |
person In Charge |
<?php
include 'config.php';
mysql_connect($server,$db_user,$db_pass);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM customer";
$result=mysql_query($query);
mysql_close();
while ($row=mysql_fetch_array($result)){
echo ("
$row[id] | ");
echo ("$row[company_name] | ");
echo ("$row[company_address] | ");
echo ("$row[tel] | ");
echo ("$row[email] | ");
echo ("$row[mobile] | ");
echo ("$row[incharge] | ");
echo ("Edit |
");
}
echo "
";
?>
<?php
}else{
header("location:login.php");
}
?>[/php]
===============================================================
Ok here is the edit_client.php

here is the full codes of edit_client.php
[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'])) {
foreach ($_POST['user_id'] as $rowid ) {
//$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 = $rowid";
$result_update = mysql_query($update);
echo $result_update;
//header("Location: edit_client.php?update=".$result_update."");
//var_dump($result_update); exit;
//echo "
Files updated
";
}
}
$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 : |
" checked = "checked" disabled = "disabled"> |
Customer ID : |
" disabled = "disabled"> |
Name : |
" disabled = "disabled"> |
Address: |
"> |
Phone Number: |
"> |
Mobile: |
"> |
Person In Charge: |
"> |
E-mail: |
"> |
<tr>
<td></td>
<td align="right"><input type="submit"
name="upload" value="upload"></td>
</tr>
<?php
}else{
header("location:login.php");
}
?>[/php]