Location: PHPKode > projects > QuickTalk Forum > quicktalk/install/qtf_setup_post.php
<?php

// QuickTalk 2.5 build:20100924

switch($oDB->type)
{

case 'mysql4':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id int,
  forum int default 0,
  topic int default 0,
  icon char(2) default "00",
  title varchar(64),
  type char(1) default "R",
  userid int,
  username varchar(24),
  issuedate varchar(20),
  modifdate varchar(20),
  modifuser int,
  modifname varchar(24),
  attach varchar(255),
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;
  
case 'mysql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id int,
  forum int default 0,
  topic int default 0,
  icon char(2) default "00",
  title varchar(64),
  type char(1) default "R",
  userid int,
  username varchar(24),
  issuedate varchar(20),
  modifdate varchar(20),
  modifuser int,
  modifname varchar(24),
  attach varchar(255),
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id int CONSTRAINT pk_'.$qtf_prefix.'qtapost PRIMARY KEY,
  forum int default 0,
  topic int default 0,
  icon char(2) default "00",
  title varchar(64) NULL,
  type char(1) default "R",
  userid int NULL,
  username varchar(24) NULL,
  issuedate varchar(20) NULL,
  modifdate varchar(20) NULL,
  modifuser int NULL,
  modifname varchar(24) NULL,
  attach varchar(255) NULL,
  textmsg text NULL
  )';
  break;

case 'pg':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id integer,
  forum integer default 0,
  topic integer default 0,
  icon char(2) default "00",
  title varchar(64),
  type char(1) default "R",
  userid integer,
  username varchar(24),
  issuedate varchar(20),
  modifdate varchar(20),
  modifuser integer,
  modifname varchar(24),
  attach varchar(255),
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;


case 'sqlite':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id integer,
  forum integer default 0,
  topic integer default 0,
  icon text default "00",
  title text,
  type text default "R",
  userid integer ,
  username text,
  issuedate text,
  modifdate text,
  modifuser integer,
  modifname text,
  attach text,
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;

case 'ibase':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id integer,
  forum integer default 0,
  topic integer default 0,
  icon char(2) default "00",
  title varchar(64),
  type char(1) default "R",
  userid integer,
  username varchar(24),
  issuedate varchar(20),
  modifdate varchar(20),
  modifuser integer,
  modifname varchar(24),
  attach varchar(255),
  textmsg varchar(32700),
  PRIMARY KEY (id)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id integer ,
  forum integer default 0,
  topic integer default 0,
  icon char(2) default "00",
  title varchar(64),
  type char(1) default "R",
  userid integer,
  username varchar(24),
  issuedate varchar(20),
  modifdate varchar(20),
  modifuser integer,
  modifname varchar(24),
  attach varchar(255),
  textmsg long varchar,
  textmsg2 varchar(255),
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtapost (
  id number(32),
  forum number(32) default 0 ,
  topic number(32) default 0 ,
  icon char(2) default "00" ,
  title varchar2(64),
  type char(1) default "R" ,
  userid number(32),
  username varchar2(24),
  issuedate varchar2(20) default "0" ,
  modifdate varchar2(20) default "0" ,
  modifuser number(32),
  modifname varchar2(24),
  attach varchar2(255),
  textmsg varchar2(4000),
  CONSTRAINT pk_'.$qtf_prefix.'qtapost PRIMARY KEY (id))';
  break;

default:
die('Database type ['.$this->type.'] not supported... Must be mysql, mssql, pg, db2, oci');

}

echo '<span style="color:blue">';
$b=$oDB->Query($strQ);
echo '</span>';

if ( !empty($oDB->error) || !$b )
{
echo '<div class="setup_err">',sprintf ($L['E_install'],$qtf_prefix.'qtapost',$qtf_database,$qtf_user),'</div>';
echo '<br/><table cellspacing="0" class="button"><tr><td></td><td class="button" style="width:120px">&nbsp;<a href="qtf_setup_1.php">',$L['Restart'],'</a>&nbsp;</td></tr></table>';
exit;
}

?>
Return current item: QuickTalk Forum