I am trying to create a table in my sql using PHP, but I am not sure how to set the initial value for the auto-increment field.
This is what I still have:
function create_table($db_host,$db_user,$db_pswrd,$db_name){ $connect = mysql_connect($db_host,$db_user,$db_pswrd) or die(mysql_error()); mysql_select_db($db_name, $connect); $sql = "CREATE TABLE MY_TABLE ( table_id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(table_id), table_1 varchar(45), table_2 varchar(45), table_3 varchar(999), table_4 varchar(45) )"or die(mysql_error()); mysql_query($sql,$connect)or die(mysql_error()); mysql_close($connect); }
So, I need to know how to set the initial value of Auto Increment in this table when creating?
thanks
user849137
source share