nodeapi_example_install

5 nodeapi_example.install nodeapi_example_install()
6 nodeapi_example.install nodeapi_example_install()

Implementation of hook_install().

File

developer/examples/nodeapi_example.install, line 7

Code

function nodeapi_example_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("
          CREATE TABLE {nodeapi_example} (
            nid int(10) unsigned NOT NULL default '0',
            rating int(10) unsigned NOT NULL default '0',
            PRIMARY KEY (nid)
          ) /*!40100 DEFAULT CHARACTER SET utf8 */;
      ");
      break;
    case 'pgsql':
      db_query("
          CREATE TABLE {nodeapi_example} (
            nid int NOT NULL default '0',
            rating int NOT NULL default '0',
            PRIMARY KEY (nid));
      ");
      break;
  }
}
Login or register to post comments