Code: Select all
<form id="inplace">
<table border="="1" width="40%" cellpadding="0" cellspacing="0" id="edit_handle">
<?php
$rquery = "SELECT RightsKey, RightsDesc FROM hh_rights";
$rresult = mysql_query($rquery) or die(mysql_error());
$edit = 0;
if ($rresult) {
while ($row = mysql_fetch_array($rresult, MYSQL_NUM)) {
$edit++;
echo "<tr>
<td><p id='edit$edit' name='rights' value='" . $row[0] . "'> " . $row[1] . "</p></td>
</tr>";
}
} else {
echo "system error";
}
?>
<script type="text/javascript">
new Ajax.InPlaceEditor('edit1', 'rights-edit.php');
new Ajax.InPlaceEditor('edit2', 'rights-edit.php');
new Ajax.InPlaceEditor('edit3', 'rights-edit.php');
new Ajax.InPlaceEditor('edit4', 'rights-edit.php');
new Ajax.InPlaceEditor('edit5', 'rights-edit.php');
new Ajax.InPlaceEditor('edit6', 'rights-edit.php');
new Ajax.InPlaceEditor('edit7', 'rights-edit.php');
</script>
</table>
</form>Code: Select all
$rk = $_GET['value'];
$v = $_GET['v'];
$query = "UPDATE hh_rights SET RightsDesc=$v WHERE RightsKey= '" . $rk . "'";