what's wrong here. not entering datas to database <html> <head> <title>xxxxxxxxxxxxxx</title> </head> <body> <form method="post" action="" name="myform"> Name <input type="text" name="text"> <input type="submit" value="add record" name="submit"> </form> <?php $name=$_POST["text"]; $linkz=mysql_connect("localhost","root","")or die("no"); mysql_select_db("test")or die("no db"); $sql="INSERT INTO student(tname)VALUES($name)"; mysql_query($sql,$linkz); echo "OK".$name."entered"; mysql_close($linkz); ?> </body> </html>
When you are adding a sql command in add or die(mysql_error())) at the end. Keep that when you are creating the software. Will save you a lot of debugging time in the end.