Question: I am using auto increment value for the inserts in my table. But is there any other way to generate a unique value (which is small enough and not GUID or UUID) in php to insert as primary key in mysql?

Basically I want to get the value that is used as PK, but using auto increment I guess I cannot get the next auto increment value?

Please suggest me something on this?

Thanks.

Answer: 
Have you tried [uniqid](http://www.php.net/manual/en/function.uniqid.php)?
you can use strtotime function

```
<?php $hash = strtotime(date('Y-m-d H:i:s')).rand(1000,9999);

```