Mutley Posted October 5, 2006 Share Posted October 5, 2006 How do I make it so when your submitting information using a form, that if the data in the database already exists, it comes up with an error? Quote Link to comment Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 By making the column [b]unique[/b], then checking for the error, so you can do something else if the error is trggered!me! Quote Link to comment Share on other sites More sharing options...
Mutley Posted October 5, 2006 Author Share Posted October 5, 2006 How do you mena unique? Do you have an example? Quote Link to comment Share on other sites More sharing options...
Hi I Am Timbo Posted October 5, 2006 Share Posted October 5, 2006 You would set the column to unique in the database. It is a property of fields. If you use PHPMyAdmin, it is the blue U when creating / modifying a field. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted October 5, 2006 Share Posted October 5, 2006 CREATE TABLE IF NOT EXISTS Users( uname VARCHAR(16) NON NULL, ... UNIQUE(uname) );http://dev.mysql.com/doc/refman/4.1/en/create-table.html Quote Link to comment 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.