BoarderLine Posted November 21, 2008 Share Posted November 21, 2008 Hi all, I am having some probs with entering a UserID into my MYSQL DB. The problem I am having is that the UserID is not Auto Incrementing. I have had this working fine before although have now changed my Registration page slightly only to find that MYSQL now throws an error for duplicate entry for the UserID field. It worked ok for several entries after i made changes although I did notice the entries were not in order +1 increments but instead all over the show from single digit #'s to the next being the full (10). Now the same entry seems to be trying to insert every time when the form is processed. I can't figure out why and this has become very frustrating. Please Help! Thanks. DB settings for UserID field: Type: Int(10) Attributes: Unsigned Null: No Extra: auto_increment Primary: Yes ----------------------------------------------------------------------------------------- $ins_users1->setTable("users"); $ins_users1->setPrimaryKey("UserID", "NUMERIC_TYPE"); Quote Link to comment https://forums.phpfreaks.com/topic/133607-solved-auto_increment-problem/ Share on other sites More sharing options...
revraz Posted November 21, 2008 Share Posted November 21, 2008 Where is your insert statement? Quote Link to comment https://forums.phpfreaks.com/topic/133607-solved-auto_increment-problem/#findComment-695125 Share on other sites More sharing options...
BoarderLine Posted November 21, 2008 Author Share Posted November 21, 2008 Ok thanks, Sorry im a little new to this (obviously haha), sorry hopefully this explains better. $ins_users1 = new tNG_insert($conn_HandsOn); $tNGs->addTransaction($ins_users1); $ins_users1->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_users1->registerTrigger("BEFORE", "Trigger_CheckEmail", 50); $ins_users1->registerTrigger("BEFORE", "CheckCaptcha", 20); $ins_users1->registerTrigger("AFTER", "Trigger_WelcomeEmail", 40); $ins_users1->registerTrigger("END", "Trigger_Default_Redirect", 99, "Home.php"); $ins_users1->setTable("users"); $ins_users1->addColumn("Last_Name", "STRING_TYPE", "POST", "Name_Last", ""); $ins_users1->addColumn("First_Name", "STRING_TYPE", "POST", "Name_First"); $ins_users1->addColumn("Contact", "STRING_TYPE", "POST", "Email1"); $ins_users1->addColumn("Entry", "STRING_TYPE", "POST", "Password1"); $ins_users1->addColumn("City", "STRING_TYPE", "POST", "city1"); $ins_users1->addColumn("MobileNum", "STRING_TYPE", "POST", "MobNum", ""); $ins_users1->addColumn("Join_Date", "DATE_TYPE", "VALUE", "{NOW} "); $ins_users1->setPrimaryKey("UserID", "NUMERIC_TYPE"); $tNGs->executeTransactions(); Quote Link to comment https://forums.phpfreaks.com/topic/133607-solved-auto_increment-problem/#findComment-695145 Share on other sites More sharing options...
BoarderLine Posted November 21, 2008 Author Share Posted November 21, 2008 Strangest thing, I removed the table from the DB and re-created it again - Prob Solved!. Quote Link to comment https://forums.phpfreaks.com/topic/133607-solved-auto_increment-problem/#findComment-695211 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.