I have this code the form is set to action on itself but when I click the submit button nothing happens no error and no data is inserted into the mysql
<html>
<head>
</head>
<title>stock</title>
<body>
<form action="st.php" method="post">
<input name="code" type="text" >
<input name="name" type="text">
<input name="submit" type="submit" >
</form>
<?php
if(isset($_POST['submit'])){
$link = mysql_connect("localhost","root","");
if(!$link){
die("cant connect" . mysql_error());
}
mysql_select_db("test",$link);
$sql= "INSERT INTO stock (sid,stcode,stname) VALUES ('','$_POST
','$_POST[name]')"; mysql_query($sql,$link); mysql_close($link); } ?> </body> </html>