I would like to ask, I'm developing a website using PHP and currently looking for a better approach.
I want to generate random string for the transaction code.
For example: Customer purchased a product, there must be transaction code to be generated and store it in database table.
Is it better to use a PHP function to generate this then check if transaction code already exists in database table or should I create a stored procedure that will do this? Which do you think is faster?