2015-03-31 88 views
0

我有一个客户的表,我需要为每个客户手动生成唯一的ID,而不是在mysql中自动增加它。如何实现这一目标?我建议下面的代码与uniqid(md5(spl_object_hash($custApp)), false);功能:如何从codeigniter中的spl_object_hash()函数生成唯一ID?

$data = file_get_contents("php://input"); 

$custApp = json_decode(base64_decode($data)); 

$custApp->Id = uniqid(md5(spl_object_hash($custApp)), false); 

,但我没有得到如何在我的代码

+0

'时间( )'最佳唯一值 – 2015-03-31 23:41:24

回答

-1

使用sha1($nombre_costumer)使用此功能并保存价值如何您的ID唯一

+1

$ nombre_costumer变量是什么? – Geetika 2015-04-01 08:40:24