Help sqlite
#1

Код:
    
Database = db_open("server.db");
db_query(Database, "CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), admin INTEGER DEFAULT 0 NOT NULL, vip INTEGER DEFAULT 0 NOT NULL, money INTEGER DEFAULT 0 NOT NULL, score INTEGER DEFAULT 0 NOT NULL, kills INTEGER DEFAULT 0 NOT NULL, deaths INTEGER DEFAULT 0 NOT NULL, kd INTEGER DEFAULT 0 NOT NULL, banned INTEGER DEFAULT 0 NOT NULL, `X` FLOAT DEFAULT 0.0, 'Y' FLOAT DEFAULT 0.0, 'Z' FLOAT DEFAULT 0.0, INT INTEGER DEFAULT 0 NOT NULL, VWORLD INTEGER DEFAULT 0 NOT NULL)");
sql.pwn(102) : error 075: input line too long (after substitutions)
sql.pwn(103) : error 037: invalid string (possibly non-terminated string)
sql.pwn(103) : error 017: undefined symbol "CREATE"
sql.pwn(103) : error 017: undefined symbol "TABLE"
fatal error 107: too many error messages on one line

Help Plz
Reply
#2

The line is to long so you need to split it up using strcat or format OR you can use Zeex's compiler which raises the line length limit.

This should work:

pawn Код:
new string[545];
strcat(string, "CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), admin INTEGER DEFAULT 0 NOT NULL");
strcat(string, ", vip INTEGER DEFAULT 0 NOT NULL, money INTEGER DEFAULT 0 NOT NULL, score INTEGER DEFAULT 0 NOT NULL, kills INTEGER DEFAULT 0 NOT NULL, deaths INTEGER DEFAULT 0 NOT NULL");
strcat(string, ", kd INTEGER DEFAULT 0 NOT NULL, banned INTEGER DEFAULT 0 NOT NULL, `X` FLOAT DEFAULT 0.0, 'Y' FLOAT DEFAULT 0.0, 'Z' FLOAT DEFAULT 0.0, INT INTEGER DEFAULT 0 NOT NULL, VWORLD INTEGER DEFAULT 0 NOT NULL");
new DB:Database = db_open("server.db");
db_query(Database, string);
If you continue getting the same error then you need to split it up even more.
Reply
#3

Quote:
Originally Posted by Chenko
Посмотреть сообщение
The line is to long so you need to split it up using strcat or format OR you can use Zeex's compiler which raises the line length limit.
sps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)