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

// QuickTalk 2.5 build:20100924

switch($oDB->type)
{
case 'mysql4':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id int,
  title varchar(64) default "untitled",
  titleorder int default 0,
  PRIMARY KEY (id)
  )';
  break;
  
case 'mysql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id int,
  title varchar(64) default "untitled",
  titleorder int default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id int CONSTRAINT pk_'.$qtf_prefix.'qtadomain PRIMARY KEY,
  title varchar(64) default "untitled",
  titleorder int default 0
  )';
  break;
  
case 'pg':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id integer,
  title varchar(64) default "untitled",
  titleorder integer default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'sqlite':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id integer,
  title text default "untitled",
  titleorder integer default 0,
  PRIMARY KEY (id)
  )';
  break;
  
case 'ibase':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id integer,
  title varchar(64) default "untitled",
  titleorder integer default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id integer,
  title varchar(64) default "untitled",
  titleorder integer default 0,
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtadomain (
  id number(32),
  title varchar2(64) default "untitled",
  titleorder number(32) default 0,
  CONSTRAINT pk_'.$qtf_prefix.'qtadomain 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.'qtadomain',$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;
}

$result=$oDB->Query( 'INSERT INTO '.$qtf_prefix.'qtadomain (id,title,titleorder) VALUES (0,"Admin hidden domain",0)' );

?>
Return current item: QuickTalk Forum