XF 2.2 Creating user with SQL command

Honestly you would be better off using the Entity system so you don't need to muck with dependencies, validating fields, etc. And if you are asking about how to do a SQL command, I'm guessing you probably don't want to be worrying about which other tables need records for the user and things like that. The entity system is made to make things consistent/easy.

In the most basic form:
PHP:
$user = \XF::em()->create('XF:User');
$user->username = 'someUser';
$user->email = 'email@example.com';
$user->save();
 
Top Bottom