Update a database table on addon install

Nudaii

Well-known member
I am pretty new to writing php, and i know i have something wrong in this code, but can't work out exactly what it is.
PHP:
<?php

class RrwsTitlePlus_Install
{
    protected static $table = array(
        'installrrwstrop' => 'UPDATE xf_user SET custom_title => TestTitle'

    );
    public static function install()
    {
        $db = XenForo_Application::get('db');
        $db->query(self::$table['installrrwstrop']);
    }


}

any ideas?
 
PHP:
<?php
class RrwsTitlePlus_Install
{
  protected static $table = array(
  'installrrwstrop' => 'UPDATE xf_user SET custom_title = TestTitle'
  );
  public static function install()
  {
  $db = XenForo_Application::getDb();
  $db->query(self::$table['installrrwstrop']);
  }
}

gives this error

Mysqli prepare error: Unknown column 'TestTitle' in 'field list'

Basically i need to set default content to all custom usertitles upon addon install.

i appreciate you guys help.
 
Top Bottom