Jump to content

ricky15

New Members
  • Posts

    1
  • Joined

  • Last visited

ricky15's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.