Hi all, I have a table that stores all of our customers, each employee adds their own customers. Currently I’m using rand() to generate a customer ID number. Just concerned that if one-day fate would have it to generate an ID that a customer already has, we’re going to have two customers sharing the same ID, that’s going to cause some serious problems.
Is there a way I can connect to MySQL, see if that id is available if so enter it, if not then generate a unique one. All without the user knowing what’s going on. It needs to be as streamlined as possible.
Really? That’s awesome, I love that Actually, just had an idea, I could just use the id which is auto-incremented. Think that’s probably the best way? Rather than finding the highest number and incrementing it by 1.