|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Any easy way to check for duplicates?
Or do I have to do this in a crappy way |
|
#2
|
|||
|
|||
|
For any field in a MySQL table, you have 3 options for field constraints:
PRIMARY, INDEX, and UNIQUE In your case, just use the UNIQUE constraint and MySQL will generate a standard error if you try to insert a duplicate record. If you want, from there you can handle it with your server-side programming to generate the appropriate 'retry' message. |
|
#3
|
|||
|
|||
|
so say I have a database of people
I go to enter in John Smith for the second time....there will be an error and I could make it do something? I'll read up on it on mysql.com i guess |
|
#4
|
|||
|
|||
|
What server-side programming language are you using?
|
|
#5
|
|||
|
|||
|
Since I have an interest in this thread, I will answer in my case. I am using PHP 4.01 -- how would this be done? Rod |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Duplicate Entries |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|