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? Link to comment https://forums.phpfreaks.com/topic/23071-error-if-entry-already-exists/ 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! Link to comment https://forums.phpfreaks.com/topic/23071-error-if-entry-already-exists/#findComment-104227 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? Link to comment https://forums.phpfreaks.com/topic/23071-error-if-entry-already-exists/#findComment-104264 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. Link to comment https://forums.phpfreaks.com/topic/23071-error-if-entry-already-exists/#findComment-104277 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 Link to comment https://forums.phpfreaks.com/topic/23071-error-if-entry-already-exists/#findComment-104330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.