I have a tbl where all entries for companies that participate in a online project are saved. This table is named "business". Those companies can use their employess to access the online platform i 've created. My idea is to ask them to give by login and registration their corresponding company's id. Of course i do not want to show the MySql business_id there for a match but a alphanumeric code, so if their company's id in the table is equal to 1 for example, then i transform this with sha1 and finally i call the first 6 characters with php's func substr(). Thats what the employee has to enter for our example, just 356a19 (because substr(sha1(1), 6) = 356a19). The matter is how am i going to select all from tbl business where a key from there if transformed like:
SUBSTR(SHA1(business_id, 0, 6))
gives a match with 356a19 (if business_id=1 etc)?