• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ I'm trying to add a VIP system Tfs 1.5

abdala ragab

Veteran OT User
Joined
Aug 18, 2018
Messages
461
Solutions
11
Reaction score
340
Location
gamelaot.sytes.net
I added this system
When I try to add

MySQL queries
Lua:
ALTER TABLE `accounts`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0 AFTER `lastday`,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0 AFTER `lastday`;
I am facing this error
Code:
Error
SQL query: Copy


ALTER TABLE `accounts`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0 AFTER `lastday`,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0 AFTER `lastdays`;
MySQL said: Documentation

#1054 - Unknown column 'lastday' in 'accounts'
How do I solve that?
 
How do I solve that?
On some TFS 1.3 and all 1.4+ there is no lastday column in accounts table.
Use this to add columns to table:
SQL:
ALTER TABLE `accounts`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0;
These columns will be added at end of table - list of columns -, but it does not matter for OTS. It's just for visualization in phpMyAdmin and other database managers.
 
On some TFS 1.3 and all 1.4+ there is no lastday column in accounts table.
Use this to add columns to table:
SQL:
ALTER TABLE `accounts`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0;
These columns will be added at end of table - list of columns -, but it does not matter for OTS. It's just for visualization in phpMyAdmin and other database managers.
Lua:
Error
SQL query: Copy


ALTER TABLE `accounts`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0;
MySQL said: Documentation

#1060 - Duplicate column name 'viplastday'
 
Lua:
Error
SQL query: Copy


ALTER TABLE `accounts`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0;
MySQL said: Documentation

#1060 - Duplicate column name 'viplastday'
IDK how, but it somehow added first column, but not second. Or somehow you already had first column in database.
Execute this to add second column:
SQL:
ALTER TABLE `accounts`
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0;
 
IDK how, but it somehow added first column, but not second. Or somehow you already had first column in database.
Execute this to add second column:
SQL:
ALTER TABLE `accounts`
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0;

Error​

SQL query: Copy



ALTER TABLE accounts
ADD COLUMN vipdays int(11) NOT NULL DEFAULT 0;



MySQL said: Documentation

#1060 - Duplicate column name 'vipdays'
Post automatically merged:

I solved it and this is the solution
SQL:
    ALTER TABLE `players`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0 AFTER `level`,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0 AFTER `level`;
 
Last edited:

Error​

SQL query: Copy



ALTER TABLE accounts
ADD COLUMN vipdays int(11) NOT NULL DEFAULT 0;



MySQL said: Documentation

#1060 - Duplicate column name 'vipdays'
Post automatically merged:

I solved it and this is the solution
SQL:
    ALTER TABLE `players`
        ADD COLUMN `viplastday` int(10) NOT NULL DEFAULT 0 AFTER `level`,
        ADD COLUMN `vipdays` int(11) NOT NULL DEFAULT 0 AFTER `level`;
yeah - nullifying the variable is good option, but still there will be a problem cus of using small ints
 
Back
Top