How do we use drupal_save function? Can somebody please elaborate?
It is quite simple. see following:
<?php user_save($account, array('mail'=>'abc@gmail.com');?>
if $account is null, a new user is created else mail information is updated for $account. I hope this helps.
Actually, if you want to create a new user account, correct syntax is:
<php><?php
$userinfo = array( 'name' => $name, 'pass' => user_password(), 'init' => $name, 'status' => 1, 'mail'=>'abc@abc.com',
'access' => time() ); $account = user_save('', $userinfo);
?> </php>
<code>
<blockcode>
<c>
<cpp>
<drupal5>
<drupal6>
<java>
<javascript>
<php>
<python>
<ruby>
<foo>
[foo]
Links to specified hosts will have a rel="nofollow" added to them.
More information about formatting options
It is quite simple. see following:
<?php
user_save($account, array('mail'=>'abc@gmail.com');
?>
if $account is null, a new user is created else mail information is updated for $account. I hope this helps.
Actually, if you want to create a new user account, correct syntax is:
<php><?php
?> </php>
Post your Answer