hi all,
i had a table and there are some users prsent in it. each user is having an edit button so now wen i click on edit button i could be able to edit that value means that label should turn as textbox with update cancel button so how can i do that please help me.
<?php
ob_start();
@session_start();
require_once ("check.php");
include 'connection.php';
$query= mysql_query("SELECT * FROM users where reportingto='$_SESSION[username]' and role='2'");
mysql_error();
$num=mysql_num_rows($query);
?>
<html>
<body>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 500px" bordercolor="red">
<tr>
<th style="color: navy;">Userid</th>
<th style="color: navy;">Username</th>
<th style="color: navy;">Password</th>
<th style="color: navy;">Role</th>
<th style="color: navy;">Status</th>
</tr>
<?php
$i=0;
while ($i < $num){
$f1=mysql_result($query,$i,"userid");
$f2=mysql_result($query,$i,"username");
$f3=mysql_result($query,$i,"password");
$f4=mysql_result($query,$i,"role");
if($f4 == 0)
$f4 = 'Super Admin';
elseif($f4== 1)
$f4 = 'Admin';
else
$f4= 'User';
$f5=mysql_result($query,$i,"status");
if($f5 == 1)
$f5 = 'Active';
else
$f5 = 'Inactive';
?>
<tr>
<td><?php echo $f1;?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f4; ?></td>
<td><?php echo $f5; ?></td>
<td>edit</td>
<?php
$i++;
}
?>
</table>
</body>
</html>