roundcubemail/program/lib/Roundcube/rcube_user.php
function insert_search($data)
    {
        if (!$this->ID)
            return false;

        $insert_cols[]   = 'user_id';
        $insert_values[] = (int) $this->ID;
        $insert_cols[]   = $this->db->quote_identifier('type');
        $insert_values[] = (int) $data['type'];
        $insert_cols[]   = $this->db->quote_identifier('name');
        $insert_values[] = $data['name'];
        $insert_cols[]   = $this->db->quote_identifier('data');
        $insert_values[] = serialize($data['data']);

        $sql = "INSERT INTO ".$this->db->table_name('searches', true)
            ." (".join(', ', $insert_cols).")"
            ." VALUES (".join(', ', array_pad(array(), count($insert_values), '?')).")";

        $insert = $this->db->query($sql, $insert_values);

        return $this->db->affected_rows($insert) ? $this->db->insert_id('searches') : false;
    }
function insert_search($data)
    {
        if (!$this->ID)
            return false;

        $insert_cols[]   = 'user_id';
        $insert_values[] = (int) $this->ID;
        $insert_cols[]   = $this->db->quote_identifier('type');
        $insert_values[] = (int) $data['type'];
        $insert_cols[]   = $this->db->quote_identifier('name');
        $insert_values[] = $data['name'];
        $insert_cols[]   = $this->db->quote_identifier('data');
        $insert_values[] = serialize($data['data']);

        $sql = "INSERT INTO ".$this->db->table_name('searches', true)
            ." (".join(', ', $insert_cols).")"
            ." VALUES (".join(', ', array_pad(array(), count($insert_values), '?')).")";

        $insert = $this->db->query($sql, $insert_values);

        return $this->db->affected_rows($insert) ? $this->db->insert_id('searches') : false;
    }
function insert_search ( $ data ) { if ( ! $ this -> ID ) return false ; $ insert_cols [ ] = 'user_id' ; $ insert_values [ ] = ( int ) $ this -> ID ; $ insert_cols [ ] = $ this -> db -> quote_identifier ( 'type' ) ; $ insert_values [ ] = ( int ) $ data [ 'type' ] ; $ insert_cols [ ] = $ this -> db -> quote_identifier ( 'name' ) ; $ insert_values [ ] = $ data [ 'name' ] ; $ insert_cols [ ] = $ this -> db -> quote_identifier ( 'data' ) ; $ insert_values [ ] = serialize ( $ data [ 'data' ] ) ; $ sql = "INSERT INTO " . $ this -> db -> table_name ( 'searches' , true ) . " (" . join ( ', ' , $ insert_cols ) . ")" . " VALUES (" . join ( ', ' , array_pad ( array ( ) , count ( $ insert_values ) , '?' ) ) . ")" ; $ insert = $ this -> db -> query ( $ sql , $ insert_values ) ; return $ this -> db -> affected_rows ( $ insert ) ? $ this -> db -> insert_id ( 'searches' ) : false ; }
Create a new saved search record linked with this user

@param array $data Hash array with col->value pairs to save

@return int  The inserted search ID or false on error
Create a new saved search record linked with this user