Re: jquery update database
<?php include_once('Connections/nlaco.php'); ?>
<?php
error_reporting(-1);
if( $_REQUEST["name"] )
{
$id = trim($_REQUEST['name']);
$query = mysql_query("SELECT * FROM house WHERE id = $id");
$upform = mysql_query($query, $db);// or die(mysql_error());
$row_upform = mysql_fetch_assoc($upform);
$totalRows_upform = mysql_num_rows($upform);
echo $totalRows_upform;
mysql_free_result($upform);
}
?>
<?php echo $id; ?><br>
<html>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">First_name:</td>
<td><input type="text" name="first_name" value="<?php echo htmlentities($row_upform['first_name'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Last_name:</td>
<td><input type="text" name="last_name" value="<?php echo htmlentities($row_upform['last_name'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Position:</td>
<td><input type="text" name="position" value="<?php echo htmlentities($row_upform['position'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Address:</td>
<td><input type="text" name="address" value="<?php echo htmlentities($row_upform['address'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">City:</td>
<td><input type="text" name="city" value="<?php echo htmlentities($row_upform['city'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">State:</td>
<td><input type="text" name="state" value="<?php echo htmlentities($row_upform['state'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Zip:</td>
<td><input type="text" name="zip" value="<?php echo htmlentities($row_upform['zip'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Phone:</td>
<td><input type="text" name="phone" value="<?php echo htmlentities($row_upform['phone'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Fax:</td>
<td><input type="text" name="fax" value="<?php echo htmlentities($row_upform['fax'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email:</td>
<td><input type="text" name="email" value="<?php echo htmlentities($row_upform['email'], ENT_COMPAT, ''); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Update record"></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="id" value="<?php echo $id; ?>">
</form>
<p> </p>
</html>