Location: PHPKode > projects > MyPhpMoney > myphpmoney_2.0/public_html/tables/table.php
<?php
/**
 * $Id: table.php 418 2007-05-17 17:29:45Z hpfn $
 *
 * Author     : courou&#64;users.sourceforge.net
 * Website    : http://allreponse.ath.cx
 *
 * Support    : http://sourceforge.net/projects/myphpmoney/
 * CVS        : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/myphpmoney/
 */

  if (isset($this) && is_object($this)) {

      ## CREATE TABLE FOR THE PART AND RECORD
      $requete1 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][0]."
      (
         CATID                          BIGINT(20)                     NOT NULL,
         USERID                         BIGINT(20)                     NOT NULL,
         CAT                            BLOB                           NOT NULL,
      KEY FK_".$_MPM['table'][0]." (USERID)
      )type = MyISAM";
      $this->query($requete1);

      ## CREATE TABLE FOR THE OPERATION OF THE ACCOUNT AND RECORD
      $requete2 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][1]."
      (
         OPID                           BIGINT(20)                     NOT NULL,
         NUMID                          BLOB                           NOT NULL,
         TEMPID                         INTEGER(1)                     NOT NULL,
         VALID_OP                       INTEGER(1)                     NOT NULL,
         USERID                         BIGINT(20)                     NOT NULL,
         DATES                          DATE                           NOT NULL,
         CAT                            BIGINT(20)                     NOT NULL,
         THIRD                          BIGINT(20)                     NOT NULL,
         COREL                          BIGINT(20)                     NOT NULL,
         COMMENTS                       BLOB                           NOT NULL,
         SOUTT                          BLOB                           NOT NULL,
         IMP                            BLOB                           NOT NULL,
         ACCOUNT                        BLOB                           NOT NULL,
         BALANCE                        BLOB                           NOT NULL,
         PERIOD                         INTEGER(1)                     NOT NULL,
      UNIQUE KEY PK_".$_MPM['table'][1]." (OPID),
      KEY FK_".$_MPM['table'][1]." (USERID)
      )type = MyISAM";
      $this->query($requete2);

      ## CREATE TABLE FOR ACCOUNT DETAILS AND RECORD
      $requete3 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][2]."
      (
         ACCOUNTID                      BIGINT(20)                     NOT NULL,
         USERID                         BIGINT(20)                     NOT NULL,
         ACCOUNT                        BLOB                           NOT NULL,
      UNIQUE KEY PK_".$_MPM['table'][2]." (ACCOUNTID),
      KEY FK_".$_MPM['table'][2]." (USERID)
      )type = MyISAM";
      $this->query($requete3);

      ## CREATE TABLE FOR THE USER AND RECORD
      $requete4 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][3]."
      (
         USERID                         BIGINT(20)                     NOT NULL,
         LOGIN_NAME                     VARCHAR(30)                    NOT NULL,
         PWD                            BLOB                           NOT NULL,
         COUNTRY_VAL                    BLOB                           NOT NULL,
         LANG_VAL                       BLOB                           NOT NULL,
         GRAPH                          BLOB                           NOT NULL,
         VISIT                          DATETIME                       NOT NULL,
         LASTVISIT2                     DATETIME                       NOT NULL,
         LASTVISIT                      DATETIME                       NOT NULL,
         EMAIL                          VARCHAR(30)                    NOT NULL,
         FIRSTNAME                      VARCHAR(30)                    NOT NULL,
         LASTNAME                       VARCHAR(30)                    NOT NULL,
      UNIQUE KEY PK_".$_MPM['table'][3]." (USERID)
      )type = MyISAM";
      $this->query($requete4);

      ## CREATE TABLE FOR THE THIRD AND RECORD
      $requete5 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][4]."
      (
         THIRDID                        BIGINT(20)                     NOT NULL,
         CATID                          BIGINT(20)                     NOT NULL,
         USERID                         BIGINT(20)                     NOT NULL,
         THIRD                          BLOB                           NOT NULL,
      UNIQUE KEY PK_".$_MPM['table'][4]." (THIRDID),
      KEY FK_".$_MPM['table'][4]."_1 (CATID),
      KEY FK_".$_MPM['table'][4]."_2 (USERID)
      )type = MyISAM";
      $this->query($requete5);

      ## CREATE TABLE FOR THE PORTFOLIO
      $requete6 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][5]."
      (
         QUOTENAME                      CHAR(10)                      NOT NULL default '',
         USERID                         BIGINT(20)                    NOT NULL default '0'
      )type = MyISAM";
      $this->query($requete6);

      ## CREATE TABLE FOR THE ORDER (ASC - DESC)
      $requete7 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][6]."
      (
         USERID                         BIGINT(20)                     NOT NULL,
         ORDERBY                        BLOB                           NOT NULL,
      UNIQUE KEY PK_".$_MPM['table'][6]." (USERID)
      )type = MyISAM";
      $this->query($requete7);

      ## CREATE TABLE FOR THE QUOTES
      $requete8 = "CREATE TABLE IF NOT EXISTS ".$_MPM['table'][7]."
      (
         QUOTENAME                      VARCHAR(10)                    NOT NULL default '',
         TIME                           BIGINT(10)                     NOT NULL default '0',
         CACHE                          TEXT                           NOT NULL
      )type = MyISAM";
      $this->query($requete8);

  } ## end if (isset($this) && is_object($this))
Return current item: MyPhpMoney