SQLite small help
#1

PHP код:
db_query(Database"CREATE TABLE IF NOT EXISTS Accounts (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(24), Password VARCHAR(129), IP VARCHAR(16), Admin INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 1 NOT NULL, Skin INTEGER DEFAULT 108 NOT NULL, Money INTEGER DEFAULT 1000 NOT NULL, Health FLOAT DEFAULT 100.0 NOT NULL, Armour FLOAT DEFAULT 0.0 NOT NULL, LPosX FLOAT DEFAULT 0.0, LPosY FLOAT DEFAULT 0.0, LPosZ FLOAT DEFAULT 0.0, LFA FLOAT DEFAULT 0.0\
    , Dead INTEGER DEFAULT 0, DPosX FLOAT DEFAULT 0, DPosY FLOAT DEFAULT 0, DPosZ FLOAT DEFAULT 0)"
); 
So i got this query but the complier giving me error because it is too long.
I tried to split this and doesn't work as you see i even tried strcat but still giving errors.
Anyway to get rid of the long message errors
Or any other way to create this table?
Reply
#2

install zeex' pawn compiler patches, allows lines to be 4095 characters,

https://sampforum.blast.hk/showthread.php?pid=2768123#pid2768123
Reply
#3

The above suggestion is very good but I'll post how it'd be with strcat as you mentioned it gave you errors:
pawn Код:
new Query[535] =
"CREATE TABLE IF NOT EXISTS Accounts (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(24), Password VARCHAR(129), IP VARCHAR(16), Admin INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 1 NOT NULL, ";
strcat(Query, "Skin INTEGER DEFAULT 108 NOT NULL, Money INTEGER DEFAULT 1000 NOT NULL, Health FLOAT DEFAULT 100.0 NOT NULL, Armour FLOAT DEFAULT 0.0 NOT NULL, LPosX FLOAT DEFAULT 0.0, LPosY FLOAT DEFAULT 0.0, ", sizeof (Query));
strcat(Query, "LPosZ FLOAT DEFAULT 0.0, LFA FLOAT DEFAULT 0.0, Dead INTEGER DEFAULT 0, DPosX FLOAT DEFAULT 0, DPosY FLOAT DEFAULT 0, DPosZ FLOAT DEFAULT 0)", sizeof (Query));
Reply
#4

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
install zeex' pawn compiler patches, allows lines to be 4095 characters,

https://sampforum.blast.hk/showthread.php?pid=2768123#pid2768123
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The above suggestion is very good but I'll post how it'd be with strcat as you mentioned it gave you errors:
pawn Код:
new Query[535] =
"CREATE TABLE IF NOT EXISTS Accounts (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(24), Password VARCHAR(129), IP VARCHAR(16), Admin INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 1 NOT NULL, ";
strcat(Query, "Skin INTEGER DEFAULT 108 NOT NULL, Money INTEGER DEFAULT 1000 NOT NULL, Health FLOAT DEFAULT 100.0 NOT NULL, Armour FLOAT DEFAULT 0.0 NOT NULL, LPosX FLOAT DEFAULT 0.0, LPosY FLOAT DEFAULT 0.0, ", sizeof (Query));
strcat(Query, "LPosZ FLOAT DEFAULT 0.0, LFA FLOAT DEFAULT 0.0, Dead INTEGER DEFAULT 0, DPosX FLOAT DEFAULT 0, DPosY FLOAT DEFAULT 0, DPosZ FLOAT DEFAULT 0)", sizeof (Query));
Thank you both for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)