Created function for randomizing unique 6 character key
Corrected Bad Logic, Compensated for PHP
Corrected MySQL SELECT Logic for PHP