reggie Posted December 24, 2007 Share Posted December 24, 2007 I want to use 1 value ($surname='surname') to generate a unique number including the surname within the number. for example SURNAME123456789. And then to store this number in the database but checking that it doesnt exsist, but if id did to generate another. Not that it would generate two identical numbers of this length.Any ideas or suggestions. I am using php and mysql. Thanks. Link to comment Share on other sites More sharing options...
zppblood Posted December 24, 2007 Share Posted December 24, 2007 Use string concatenation with mt_rand(num1, num2) ($surname.mt_rand(1, 100)) or uniqid($surname, true).http://us3.php.net/manual/en/function.mt-rand.phphttp://us3.php.net/manual/en/function.uniqid.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.