PHP_MySQL教程-第二天
来源:PHPerz.com 作者:网络转载 发布时间:2007-12-07
if (
$submit) {
$sql = "UPDATE employees SET first='$first',last='$last',
address='$address',position='$position' WHERE id=$id";
$result = mysql_query($sql);
echo "谢谢!数据更改完成n";
} else {
// 查询数据库
$sql = "SELECT * FROM employees WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PATH_INFO?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
名:<input type="Text" name="first" value="<?php
echo $myrow["first"] ?>"><br> 姓:<input type="Text" name="last" value="<?php echo
$myrow["last"] ?>"><br> 住址:<input type