I’d use the auto-increment ticket id. I don’t see what purpose a second unique id might be unless you particularly want or need it to be in some other format.
What have you looked at so far? There are loads of OSS PHP-based ticket systems out there - Mantis is one that springs to mind. Do you really need to write your own, or could you integrate a pre-packaged system into your site?