Datamanager error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stopy
    New Member
    • May 2006
    • 21
    • 3.6.x

    Datamanager error

    Hi,
    I'm developing a class to save users directly from my system bypassing vbulletin.

    I have a problem.
    Saving data I get database tipical vbulletin error but, datas are correct saved!

    My code follow, is someone able to tell me why appens this?
    (informations are for test)

    Thanks

    PHP Code:
    <?php
    require_once('./global.php');
    $dm =& datamanager_init('User'$vbulletinERRTYPE_ARRAY); 

    $dm->set('username','utentedadm8');
    $dm->set('usergroupid',2);
    $dm->set('password','123456');
    $dm->set('email','[email protected]');
    $dm->set('usertitle','Matricola');
    $dm->set('timezoneoffset',2);
    $dm->set('birthday','10-06-1984');
    $dm->set('birthday_search','1984-06-10');
    $dm->set('pmpopup',1);
    $dm->set('ipaddress',$_SERVER['REMOTE_ADDR']);
    $dm->set('autosubscribe',2);
    $dm->set('startofweek',2);



    $dm->pre_save();
    if (
    count($dm->errors) > 0)
    {
        
    // Errors occurred. Do not proceed with the save.
        // You may want to loop through $dataman->errors and 
        // display the results the user.
        
    echo "ERRORS <pre>";
        
    print_r($dm->errors);
        echo 
    "</pre>";
       
    }
    else
    {
        
    // No errors occurred.
        // Proceed with the save (see the next step).
        // inserting a new user
            
    $userid $dm->save();
            echo 
    $userid;
            
    // updating an existing record
            
    @$dm->save();
            
            
    }  

    ?>
  • stopy
    New Member
    • May 2006
    • 21
    • 3.6.x

    #2
    Sorry I'm an'idiot!
    I called save() twice!!!

    Comment

    Related Topics

    Collapse

    Working...