自动递增一行(ID)

I'm trying to AUTO_INCREMENT a row.

When creating a row for the table, is INT better than TEXT? I use varchar for the other rows, but I presume using AUTO_INCREMENT with varchar would be completely pointless.

The row is called 'ID', and is suppose to AUTO_INCREMENT every time data is inserted into other rows. Since its suppose to AUTO_INCREMENT, rather than the other rows which allows the user to input data, would it be better to modify 'serverid' below, or disable input on the ID field of my HTML form?

Here is my code:

// Inserting input values into its respected row
$serverip=$_POST['post_serverid'];
$serverid=$_POST['post_serverip'];
$serverid=$_POST['post_serverport'];
$serverid=$_POST['post_servertitle'];
$serverid=$_POST['post_serverdesc'];
$serverid=$_POST['post_serverwebsite'];
$query = mysqli_query($con,"INSERT INTO servers (serverid, serverip, serverport,   
servertitle, serverdesc, serverwebsite) VALUES       
('$serverid','$serverip','$serverport','$servertitle','$serverdesc','$serverwebsite')");

When defined for an AUTO INCREMENT, there is no meaning in inputting values manually.

And at times there is also a chance that you unknowingly input a value that already present in the table. To avoid such possibilities, you better omit the auto incremented field from the insert statement.

And if you still are interested to use the field in the insert statement, you can safely use a NULL or a 0(zero) into it. So that the engine will replace it with the new value from the auto increment and use it for insertion.

If you are inputting the values from a web form, you can remove the auto increment field from the form.

You shouldn't have to increment the ID from your html/php anywhere. You should set that in the database itself, as an INT with a PRIMARY index and AUTO_INCREMENT checked. Then every entry will be assigned a unique id which you can query later.