Revision: 40586
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at February 4, 2011 03:04 by amyb
Initial Code
$unique = FALSE; while ($unique == FALSE){ $ref = md5(date('r', time()) . rand(0,100)); $check_ref = mysql_query("SELECT ref FROM table_name WHERE ref = '$ref'"); if(mysql_num_rows($check_ref)==0){ $unique = TRUE; } }
Initial URL
Initial Description
Initial Title
Generate a random reference code and check it's unique
Initial Tags
Initial Language
PHP