Forum Moderators: coopster

Message Too Old, No Replies

PHP MySQL Disallow Same Value

         

McBlack

12:06 am on Jan 25, 2008 (gmt 0)

10+ Year Member



How could I make in a php mysql POST code to not allow a certain column to have the same values?

coopster

1:36 am on Jan 25, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



When you CREATE the TABLE you can use the UNIQUE keyword for that column. Any INSERT statement using a duplicate value will fail. Then all you have to do is monitor for that duplicate error.