• 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!

How to set table to NOT NULL?

zerghel

Tsuni
Joined
Jul 1, 2008
Messages
299
Reaction score
9
im using this premium point by action

Code:
local points = 1
function onUse(cid, item, frompos, item2, topos)
db.executeQuery("UPDATE `accounts` SET `premium_points`  = `premium_points`  + " .. points .. "  WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
doRemoveItem(item.uid, 1)
doCreatureSay(cid, 'You have received 1 premium point!', TALKTYPE_ORANGE_1)
end

but the thing is that the premium points table is NULL by default i guess, so the points never adds, there's anyway to modify the query to set the table NOT NULL?
 
im using this premium point by action

Code:
local points = 1
function onUse(cid, item, frompos, item2, topos)
db.executeQuery("UPDATE `accounts` SET `premium_points`  = `premium_points`  + " .. points .. "  WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
doRemoveItem(item.uid, 1)
doCreatureSay(cid, 'You have received 1 premium point!', TALKTYPE_ORANGE_1)
end

but the thing is that the premium points table is NULL by default i guess, so the points never adds, there's anyway to modify the query to set the table NOT NULL?
u need to add a table into your database i mean .s3db accounts/make here a new table called premium_points, edit table, constrain, not null and default put 0
 
the table premium_points is already created by modern acc, but it's NULL by default, so every time someone makes an account has it NULL by default
 
i'm not sure what you mean, but i think this is the query that created the table:
Code:
ALTER TABLE `accounts` ADD `premium_points` int(11);
i got it form dbschema.txt on htdocs/install folder
 
and it is null? if it is change the predeterminated number in the structure to 0 and I think you will got it.

go to table accounts then click on structure that is in the menu, check the column 'accounts', click on change or edit and change the null by a 0
 
Back
Top