I am using simple MySQL code to insert data from a form with auto_increment id, it works fine on local host but not on server.
this is the code I am using
$myvar=$_POST['var'];
//Insert data into mysql table
$sql="INSERT INTO mytable(id,myvar) VALUES ('','$myvar')";
in local host phpmyadmin data is inserted in table but on server phpmyadmin data is not inserted in table. In my localhost I am using XAMPP
whereas phpmyadmin on IIS server.
What setting should I do in phpmyadmin on server so that id is automatically inserted with auto increment, I know I can use mysql_insert_id()
to insert id but in lots of file i have used this type of code which I cannot change. I want the same setting as XAMPP
that can take this type of code easily.