SA-MP Forums Archive
input line too long (after substitutions) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: input line too long (after substitutions) (/showthread.php?tid=628325)



input line too long (after substitutions) - UnholyBeast - 09.02.2017

I am getting this error while trying to implement a SQLite database.

Код:
db_query(database, "CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), score INTEGER DEFAULT 0 NOT NULL, cash INTEGER DEFAULT 0 NOT NULL, bank_cash INTEGER DEFAULT 0 NOT NULL, admin INTEGER DEFAULT 0 NOT NULL, kills INTEGER DEFAULT 0 NOT NULL, deaths INTEGER DEFAULT 0 NOT NULL, jail_time INTEGER DEFAULT 0 NOT NULL, rp INTEGER DEFAULT 0 NOT NULL, vip INTEGER DEFAULT 0 NOT NULL, cop_rank INTEGER DEFAULT 0 NOT NULL, army INTEGER DEFAULT 0 NOT NULL)");
How exactly do I fit all this in, and/or how would I split all this into multiple lines, and still have it work?


Re: input line too long (after substitutions) - AndreiWow - 09.02.2017

PHP код:
db_query(database"CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), 
score INTEGER DEFAULT 0 NOT NULL, 
cash INTEGER DEFAULT 0 NOT NULL, bank_cash INTEGER DEFAULT 0 NOT NULL, 
admin INTEGER DEFAULT 0 NOT NULL, kills INTEGER DEFAULT 0 NOT NULL, deaths INTEGER DEFAULT 0 NOT NULL, jail_time INTEGER DEFAULT 0 NOT NULL, 
rp INTEGER DEFAULT 0 NOT NULL, vip INTEGER DEFAULT 0 NOT NULL, cop_rank INTEGER DEFAULT 0 NOT NULL, army INTEGER DEFAULT 0 NOT NULL)"
); 
Try this but why don't you create the table manually..?


Re: input line too long (after substitutions) - saffierr - 09.02.2017

Exactly, It'd be better if you create the table manually.


Re: input line too long (after substitutions) - Mic_H - 09.02.2017

Quote:
Originally Posted by How to Remove
PHP код:
new string[952];
strcat(string"CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT,");
strcat(string"username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), score INTEGER DEFAULT 0 NOT NULL, ");
strcat(string"cash INTEGER DEFAULT 0 NOT NULL, bank_cash INTEGER DEFAULT 0 NOT NULL, ");
strcat(string"admin INTEGER DEFAULT 0 NOT NULL, kills INTEGER DEFAULT 0 NOT NULL, deaths INTEGER DEFAULT 0 NOT NULL, ");
strcat(string"jail_time INTEGER DEFAULT 0 NOT NULL,rp INTEGER DEFAULT 0 NOT NULL, vip INTEGER DEFAULT 0 NOT NULL, ");
strcat(string"cop_rank INTEGER DEFAULT 0 NOT NULL, army INTEGER DEFAULT 0 NOT NULL)");
db_query(databasestring
And doing it manually would be better, like the above guys mentioned.


Re: input line too long (after substitutions) - Sabur - 09.02.2017

Use zeex compiler, it'll fix your problem.
https://github.com/Zeex/pawn/releases


Re: input line too long (after substitutions) - UnholyBeast - 09.02.2017

I'll just make it manually. Honestly didn't even though that was an option. I have just begun to work with SQL.