News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

eror install database on sqlite

Started by pjn, September 16, 2012, 05:54:20 AM

Previous topic - Next topic

pjn

i try to install some modes with new tables, and i get erors!

for exsample, this mod:

QL logic error or missing database
near "DEFAULT": syntax error
files: /hermes/bosoraweb012/b113/ipg.iltubecom/domains/kj-il.net/forums/Packages/temp/AjaxChat Integration_3.2.1 RC3_Curve_Friendly/Tables_2.php
line: 20


<?php

if(file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
   require_once(
dirname(__FILE__) . '/SSI.php');
else if(!
defined('SMF'))
   die(
'<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php and SSI.php files.');

if((
SMF == 'SSI') && !$user_info['is_admin'])
   die(
'Admin priveleges required.');

//remove previous version's tabales

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxchat_online (
userID INT(11) NOT NULL,
userName VARCHAR(64) NOT NULL,
userRole INT(1) NOT NULL,
channel INT(11) NOT NULL,
dateTime DATETIME NOT NULL,
ip VARBINARY(16) NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());   ->>>>>>>>>>>>>>>>>>>this is line 20


$smcFunc
['db_query']('''CREATE TABLE {db_prefix}ajaxchat_messages (
id INT(11) NOT NULL AUTO_INCREMENT,
userID INT(11) NOT NULL,
userName VARCHAR(64) NOT NULL,
userRole INT(1) NOT NULL,
channel INT(11) NOT NULL,
dateTime TIMESTAMP NOT NULL,
ip VARBINARY(16) NOT NULL,
text TEXT,
PRIMARY KEY (id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxchat_bans (
userID INT(11) NOT NULL,
userName VARCHAR(64) NOT NULL,
dateTime DATETIME NOT NULL,
ip VARBINARY(16) NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxchat_invitations (
userID INT(11) NOT NULL,
channel INT(11) NOT NULL,
dateTime TIMESTAMP NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

$smcFunc['db_query']('''DROP TABLE IF EXISTS {db_prefix}ajaxshout_online', array());
$smcFunc['db_query']('''DROP TABLE IF EXISTS {db_prefix}ajaxshout_messages', array());
$smcFunc['db_query']('''DROP TABLE IF EXISTS {db_prefix}ajaxshout_bans', array());
$smcFunc['db_query']('''DROP TABLE IF EXISTS {db_prefix}ajaxshout_invitations', array());

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxshout_online (
userID INT(11) NOT NULL,
userName VARCHAR(64) NOT NULL,
userRole INT(1) NOT NULL,
channel INT(11) NOT NULL,
dateTime DATETIME NOT NULL,
ip VARBINARY(16) NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxshout_messages (
id INT(11) NOT NULL AUTO_INCREMENT,
userID INT(11) NOT NULL,
userName VARCHAR(64) NOT NULL,
userRole INT(1) NOT NULL,
channel INT(11) NOT NULL,
dateTime DATETIME NOT NULL,
ip VARBINARY(16) NOT NULL,
text TEXT,
PRIMARY KEY (id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxshout_bans (
userID INT(11) NOT NULL,
userName VARCHAR(64) NOT NULL,
dateTime DATETIME NOT NULL,
ip VARBINARY(16) NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

$smcFunc['db_query']('''CREATE TABLE {db_prefix}ajaxshout_invitations (
userID INT(11) NOT NULL,
channel INT(11) NOT NULL,
dateTime DATETIME NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin'
, array());

if(
SMF == 'SSI')
   echo 
'Database changes are complete!';

?>



i have a-sqlite, this give a problem????
Quick Portal - Free hosting & portal & forums system

Many designs + many extras + server = FREE!

Ask from us your free web now:
http://qp-free.com/index.php/board,2.0.html

emanuele

The problem is that the mod is not compatible with SQLite...

In order to be compatible it shouldn't use db_query to create tables, but db_create_table...

Additionally, I'm not sure if ajaxchat itself supports SQLite, o you'd probably need to convert ajaxchat as well to have it working on SQLite.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

pjn

Quick Portal - Free hosting & portal & forums system

Many designs + many extras + server = FREE!

Ask from us your free web now:
http://qp-free.com/index.php/board,2.0.html

emanuele

All these mods are not written supporting the SMF database abstraction layer and for that reason they support only mysql...

To give you an example, try to install the mod attached here. It works flawless with SQLite too.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: