title: Cannot insert data to mysql table using INSERT INTO
body: <p>In WAMP and in phpMyadmin I created a database called PROJECT with this table</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(25) NOT NULL,
  `password` varchar(25) NOT NULL,
   PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  </code></pre>
  
  <p>I am trying to test the following code:</p>
  
  <pre><code>&lt;?php
  $con=mysql_connect ("localhost","******","");
  mysql_select_db("project",$con);
  @$a=$_POST['txt1'];
  @$b=$_POST['txt2'];
  if(@$_POST['inser'])
  {
   $s="INSERT INTO users VALUES ('','$a','$b')";
  echo "Your Data Inserted";
   mysql_query ($s);
  }
  $con=mysql_connect ("localhost","******","");
  mysql_select_db ("project",$con);
  if(@$_POST ['sel'])
  {
  echo $ins=mysql_query ("select * from users");
  echo "&lt;table bgcolor=skyblue border='2'&gt;
  &lt;tr&gt;
  &lt;th colspan=4&gt;Display details&lt;/th&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;th&gt;ID&lt;/th&gt;
  &lt;th&gt;Username&lt;/th&gt;
  &lt;th&gt;Password&lt;/th&gt;
  &lt;/tr&gt;";
  while ($row=mysql_fetch_array ($ins))
  {
  echo "&lt;tr&gt;";
  echo  "&lt;th&gt;".$row ['id']."&lt;/th&gt;";
  echo  "&lt;th&gt;".$row ['username']."&lt;/th&gt;";
  echo  "&lt;th&gt;". $row ['password']. "&lt;/th&gt;";
  
  echo "&lt;/tr&gt;";
  }
  }
  echo "&lt;/table&gt;"
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body bgcolor="pink"&gt;
  &lt;table bgcolor="skyblue" border="2"&gt;
  &lt;form method="post"&gt;
  &lt;tr&gt;
  &lt;td colspan=2 align="center"&gt;Details&lt;/td&gt;
  &lt;/tr&gt;
  &lt;td&gt;Username&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="txt1"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Password&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="txt2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="submit" name="inser" value="Insert"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="sel" value="Select"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/form&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I insert manually username and password in the database and click the Select button then I have the record. When I try to insert a record using the INSERT INTO above it is impossible to add the record. I have the message YOUR DATA INSERTED but there is no record in the database. I tried it without the field ID and it works perfect. I tried it also without AUTO INCREMENT but without results. So what is the problem with the ID?</p>