这段程序肯定有错,但就是不知道错在那里,大家帮帮忙,
<html>
<form method="post" action="<?php echo $PATH_INFO?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
名:<input type="text" name="first"><br>
姓:<input type="text" name="last"><br>
住址:<input type="text" name="address"><br>
职务:<input type="text" name="position"><br>
<input type="submit" name="submit" value="提交数据"><br>
</form>
<?php
if($submit)
{
echo "submit!\n";
$db=mysql_connect("localhost","root");
mysql_select_db("mydb",$db);
$sql="INSERT INTO employees(first,last,address,position)
VALUES('$first','$last','address','postion')";
$result=mysql_query($sql);
echo "添加数据库成功!请查看数据库中的数据";
}
?>
</html>
连echo “submit”都没执行,晕啊,我的mysql中已经有mydb数据库了。