user warning: Unknown column 'page' in 'where clause' query: SELECT * FROM view_view WHERE page = 1 in /Volumes/INPROL_DATA/WebServer/Documents/includes/database.mysql.inc on line 120.

Keep getting this error. Removed Views module. Dropped Views tables. Reinstalled Views module (downloaded from project/modules, not cvs).

Comments

trailerparkopera’s picture

I think I've narrowed down the problem: views.install isn't working in the cvs version, at least for my system. Problems went away when I manually installed Views tables used code stripped from the .install file. Here it is if anyone else needs it.

CREATE TABLE if not exists view_view (
        vid int(10) unsigned NOT NULL default '0',
        name varchar(32) NOT NULL UNIQUE,
        description varchar(255),
        access varchar(255),
        -- page fields
        page int(1),
        page_title varchar(255),
        page_header longtext,
        page_header_format int(4) NOT NULL,
        page_empty longtext,
        page_empty_format int(4) NOT NULL,
        page_footer longtext,
        page_footer_format int(4) NOT NULL,
        page_type varchar(20),
        use_pager int(1),
        nodes_per_page int(5),
        url varchar(255),
        -- menu fields
        menu int(1),
        menu_tab int(1),
        menu_tab_default int(1),
        menu_tab_weight int(4),
        menu_title varchar(255),
        -- block fields
        block int(1),
        block_title varchar(255),
        block_use_page_header int(1),
        block_header longtext,
        block_header_format int(4) NOT NULL,
        block_use_page_footer int(1),
        block_footer longtext,
        block_footer_format int(4) NOT NULL,
        block_use_page_empty int(1),
        block_empty longtext,
        block_empty_format int(4) NOT NULL,
        block_type varchar(20),
        nodes_per_block int(5),
        block_more int(1),
        -- breadcrumb
        breadcrumb_no_home int(1), -- true means start breadcrumb trail from 'Home'.
        -- other
        changed int(11),
        query longtext,
        countquery longtext,
        view_args_php longtext,
        PRIMARY KEY (vid),
        KEY (name)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

  CREATE TABLE if not exists view_sort (
        vid int(10) unsigned NOT NULL default '0',
        position int(2),
        field varchar(255),
        sortorder varchar(5),
        options varchar(255),
        tablename varchar(255),
        KEY (vid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

  CREATE TABLE if not exists view_argument (
        vid int(10) unsigned NOT NULL default '0',
        type varchar(255),
        argdefault varchar(255),
        title varchar(255),
        options varchar(255),
        position int(2),
        wildcard varchar(32),
        wildcard_substitution varchar(32),
        KEY (vid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

  CREATE TABLE if not exists view_tablefield (
        vid int(10) unsigned NOT NULL default '0',
        tablename varchar(255),
        field varchar(255),
        label varchar(255),
        handler varchar(255),
        sortable int(1),
        defaultsort varchar(5),
        options varchar(255),
        position int(2),
        KEY (vid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

  CREATE TABLE if not exists view_filter (
        vid int(10) unsigned NOT NULL default '0',
        tablename varchar(255),
        field varchar(255),
        value longtext,
        operator varchar(20),
        options varchar(255),
        position int(2),
        KEY (vid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

  CREATE TABLE if not exists view_exposed_filter (
        vid int(10) unsigned NOT NULL default '0',
        field varchar(255),
        label varchar(255),
        optional int(1),
        is_default int(1),
        operator int(1),
        single int(1),
        position int(2),
        KEY (vid)
      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;

merlinofchaos’s picture

Could you give me the results of a 'describe view_view'?

merlinofchaos’s picture

Whoops, missed the followup when I replied. Sorry.

mariuss’s picture

Same problem here.

Also, upgraded from Drupal 4.6 and the views module did not upgarde the tables at all.

merlinofchaos’s picture

For the 4.6 upgrade, you are probably stuck dropping your tables and reinstalling Views. So much changed in the table layout that an upgrade path never got written from 4.6 to 4.7, and the .install files didn't exist when I made the changeover, so there wasn't really an easy way to do it.

See http://drupal.org/node/64165 for instructions on how to reset the tables and re-install the module.

merlinofchaos’s picture

Status: Active » Closed (won't fix)