为什么不能录入数据到表格
<?php
//这是文件write.php
if ((username!="") and (text!=""))
{ $connect=mysql_connect("localhost","root");
//为字段插入值
$query="insert into talk(username,date,text) values ('$username','$date','$text')";
//执行myweb数据表
$result=mysql_db_query('liaotian',$query);
}
?>
<html>
<head>
<title>用户输入</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
</head>
<body bgcolor="#FFFFF" text="#00000">
<form method="post" action="write.php" ><p>
你的昵称:<input type="text" name="username" size="12">
发言 <input type="text" name="text" size="57">
<input type="submit" value="提交"></p>
</form>
</body>
</html>
数据库中包含一个talk表,但是运行这个页面后,录入到表中username,text是空的,谁能帮我看看这个代码哪里错了
我新人,没多少分的,见谅啊