sivanath.nagendran Posted December 13, 2006 Share Posted December 13, 2006 Hi I am newbie to SQL queries and aso database field. I need one help, how to assign to one variable as a Unique key?Pls anyone can help to this. Explain me more brieflyAdvance thanks for your concentration.BySivanath.N Quote Link to comment https://forums.phpfreaks.com/topic/30418-how-to-assign-unique-key/ Share on other sites More sharing options...
Shazbot! Posted January 11, 2007 Share Posted January 11, 2007 I am new to this as well but I will try to answer the question.set one field as a unique key in the database and then create the unique key on the client. Example, I need to keep track of applications that people fill out. I require them to enter their email address and use that as part of the unique key. I then concatenate the email address with a date and time stamp. I use this as a reference for that person. The likely hood of someone with the same email address filling out the form at the exact same time and second is highly unlikely.Now this is different from a primary key.hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/30418-how-to-assign-unique-key/#findComment-158542 Share on other sites More sharing options...
bibby Posted January 21, 2007 Share Posted January 21, 2007 [code]ALTER TABLE table ADD UNIQUE KEY (fieldname)[/code]This is not auto_incrementing. Quote Link to comment https://forums.phpfreaks.com/topic/30418-how-to-assign-unique-key/#findComment-165517 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.