Auto Id Number in New User Registration

Re: Moodle in English: Re: Moodle in English: Auto Id Number in New UserRegistration

by Chriss Medina -
Number of replies: 0
Hi Sameh, I know this post is pretty old, but I´m trying to find a way to auto generate username, I try your code


$sql = 'SELECT id FROM mood_user ORDER BY id DESC limit 1';
$result = $DB->get_field_sql($sql);
$newid=20140000+$result+1;
//echo $result.'sam';
?><?

But I think something is missing.


Do you achieve it?


THX