1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

²h Create table and insert column via code

Discussion in 'XenForo Development Discussions' started by Walky, Sep 16, 2014.

  1. Walky

    Walky Member

    Hello,

    I would like to create a table and insert 2 columns in this :)
    I have this code :
    PHP:
    if($options->dark_taigachat_ban_group 0){          
                
    // ban via secondary group
                            
                /** @var XenForo_DataWriter_User */
                
    $userWriter XenForo_DataWriter::create('XenForo_DataWriter_User');
                
    $userWriter->setExistingData($message['user_id']);
              
                
    $secondaryGroups explode(','$userWriter->get('secondary_group_ids'));          
                if(!
    in_array($options->dark_taigachat_ban_group$secondaryGroups)){
                    
    $secondaryGroups[] = $options->dark_taigachat_ban_group;
                }
              
                
    $userWriter->setSecondaryGroups($secondaryGroups);
                
    $userWriter->save();  
    So I want to create a table in the database with code and insert 2 colums in this, how can I do that ?

    Thanks
     

Share This Page