The code below generates a profile id in the form yyyymmdd01, we want to modify it to generate the profile id in th e form yymmdd00001. Any help will be appreciated.
------------------------Code begins below this line -----------------
function generateid()
{
$selectregcount=mysql_fetch_array(mysql_query("SELECT * FROM mlm_reg_count WHERE reg_id=1"));
$renewdate=explode("-",$selectregcount['reg_date']);
$currmonth=date("m");
$currentyear=date("y");
$curdate=date("d");
if(($renewdate[0]<$currentyear) || ($renewdate[1]<$currmonth)|| ($renewdate[2]<$curdate)) {
$updateregcount=mysql_query("UPDATE mlm_reg_count SET reg_count=1, reg_date=NOW() WHERE reg_id=1");
return $currentyear.$currmonth.$curdate."01";
} else {
$currentcount=$selectregcount['reg_count']+1;
$updateregcount=mysql_query("UPDATE mlm_reg_count SET reg_count=$currentcount WHERE reg_id=1");
if($selectregcount['reg_count']<=9)
{
return $renewdate[0].$renewdate[1].$renewdate[2]."0".$currentcount;
}
else
{
return $renewdate[0].$renewdate[1].$renewdate[2].$currentcount;
}
}
}
----------code ends above this line--------------------------
Thank you!