Unique text field in MySQL and php
问题 I've created a salt using; md5(rand(0,10000000)); (there is probably a better way?) There doesn't seem to be possible to make a text field unique in MYSQL. So how do I check if the salt has already been used for a previous user? Or should I generate the salt based on the current date/time? as it is impossible for 2 users to register at exactly the same time correct? 回答1: For a salt, uniqueness is more important than length and predictability. You assume the attacker has the salt. A