How to create random string and check if it exists form database , if it does create a new one using php.You can use php time() function to create random string and convert it using md5() function.


How to call to this function to get value.

Note:exists_in_db() is a function.You must write this function after getting parameter and it check in the database and return value.