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

// QuickTalk 2.5 build:20100924

switch($oDB->type)
{

case 'mysql4':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar(10),
  objlang varchar(2),
  objid varchar(24),
  objname text,
  PRIMARY KEY (objtype,objlang,objid)
  )';
  break;
  
case 'mysql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar(10),
  objlang varchar(2),
  objid varchar(24),
  objname varchar(4000),
  PRIMARY KEY (objtype,objlang,objid)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar(10) NOT NULL,
  objlang varchar(2) NOT NULL,
  objid varchar(24) NOT NULL,
  objname varchar(4000) NULL,
  CONSTRAINT pk_'.$qtf_prefix.'qtalang PRIMARY KEY (objtype,objlang,objid)
  )';
  break;

case 'pg':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar(10),
  objlang varchar(2),
  objid varchar(24),
  objname varchar(4000),
  PRIMARY KEY (objtype,objlang,objid)
  )';
  break;

case 'sqlite':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype text,
  objlang text,
  objid text,
  objname text,
  PRIMARY KEY (objtype,objlang,objid)
  )';
  break;

case 'ibase':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar(10),
  objlang varchar(2),
  objid varchar(24),
  objname varchar(4000),
  PRIMARY KEY (objtype,objlang,objid)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar(10),
  objlang varchar(2),
  objid varchar(24),
  objname varchar(4000),
  PRIMARY KEY (objtype,objlang,objid)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qtf_prefix.'qtalang (
  objtype varchar2(10),
  objlang varchar2(2),
  objid varchar2(24),
  objname varchar2(4000),
  CONSTRAINT pk_'.$qtf_prefix.'qtalang PRIMARY KEY (objtype,objlang,objid))';
  break;

default:
  die("Database type [{$oDB->type}] not supported... Must be mysql, mssql, pg, sqlite, firebird, 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.'qtalang',$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