about adding some SQL code while register

about adding some SQL code while register

by yeung Patrick -
Number of replies: 3

I want to add some SQL code while new member register

I think I should add them in the insert_record() function. Is it right?

But I can find where the insert_record() located

Thank you very much~

Average of ratings: -
In reply to yeung Patrick

Re: about adding some SQL code while register

by yeung Patrick -

But I can find where the insert_record() located -> But I can't find where the insert_record() located

In reply to yeung Patrick

Re: about adding some SQL code while register

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't think you really want to add some SQL when a new member registers.

You want to achieve some real-world effect. If you tell us what you are actually trying to achieve, we are more likely to be able to advise you.


And if you are working on Moodle, you need to be able to find things yourself. In a command line world, you need a command like

grep -R 'function insert_record' *

of if you use an editor, try to find out if it has a 'search all files in this directory' feature.


As it happens, insert record is in lib/dmllib.php. But you definitely don't want to change that. It is a very low-level function that is used everywhere. If you change it, you will probably just break Moodle.