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

Windows Error "mysql_real_query():" .exe file issue.

vakacjus

Lua & C++ Study.
Joined
Oct 23, 2008
Messages
255
Solutions
1
Reaction score
26
I have got an error :
mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)

And after that I have got this :

[18/02/2010 14:01:24] Point has logged in.
[18/02/2010 14:01:24] mysql_real_query(): SELECT `auction_balance` FROM `players` WHERE `id` = 7; - MYSQL ERROR: Unknown column 'auction_balance' in 'field list' (1054)

[18/02/2010 14:01:24] [Error - CreatureScript Interface]
[18/02/2010 14:01:24] data/creaturescripts/scripts/login.lua:eek:nLogin
[18/02/2010 14:01:24] Description:
[18/02/2010 14:01:24] data/lib/004-database.lua:60: [Result:getDataInt] Result not set!
[18/02/2010 14:01:24] stack traceback:
[18/02/2010 14:01:24] [C]: in function 'error'
[18/02/2010 14:01:24] data/lib/004-database.lua:60: in function 'getDataInt'
[18/02/2010 14:01:24] data/creaturescripts/scripts/login.lua:23: in function <data/creaturescripts/scripts/login.lua:12>
[18/02/2010 14:01:24] Point has logged out.

Please Help :)


// Full issue :
Code:
[18/02/2010 13:56:14] > Map loading time: 34.765 seconds.
[18/02/2010 13:56:15] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Chrak.xml).
[18/02/2010 13:56:15] Info: failed to load external entity "data/npc/Chrak.xml"


[18/02/2010 13:56:15] [Spawn::addMonster] Cannot find "Battlemaster Zunzu"
[18/02/2010 13:56:15] [Spawn::addMonster] Cannot find "Battlemaster Zunzu"
[18/02/2010 13:56:15] [Spawn::addMonster] Cannot find "Battlemaster Zunzu"
[18/02/2010 13:56:19] > Data parsing time: 4.281 seconds.
[18/02/2010 13:56:19] mysql_real_query(): SELECT `house_id`, `player_id`, `bid` FROM `house_auctions` WHERE `endtime` < 1266497779 - MYSQL ERROR: Table 'unitra1.house_auctions' doesn't exist (1146)
[18/02/2010 13:56:19] > Houses synchronization time: 0.297 seconds.
[18/02/2010 13:56:24] > Content unserialization time: 5.063 seconds.
[18/02/2010 13:56:24] >> Checking world type... PvP
[18/02/2010 13:56:24] >> Initializing game state modules and registering services...
[18/02/2010 13:56:25] > Global address: localhost
[18/02/2010 13:56:25] > Local ports: 7171	7172	
[18/02/2010 13:56:25] >> All modules were loaded, server is starting up...
[18/02/2010 13:56:25] >> Forgotten server Online!

[18/02/2010 13:56:40] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 13:57:41] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 13:58:42] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 13:59:43] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 14:00:44] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 14:01:24] Point has logged in.
[18/02/2010 14:01:24] mysql_real_query(): SELECT `auction_balance` FROM `players` WHERE `id` = 7; - MYSQL ERROR: Unknown column 'auction_balance' in 'field list' (1054)

[18/02/2010 14:01:24] [Error - CreatureScript Interface] 
[18/02/2010 14:01:24] data/creaturescripts/scripts/login.lua:onLogin
[18/02/2010 14:01:24] Description: 
[18/02/2010 14:01:24] data/lib/004-database.lua:60: [Result:getDataInt] Result not set!
[18/02/2010 14:01:24] stack traceback:
[18/02/2010 14:01:24] 	[C]: in function 'error'
[18/02/2010 14:01:24] 	data/lib/004-database.lua:60: in function 'getDataInt'
[18/02/2010 14:01:24] 	data/creaturescripts/scripts/login.lua:23: in function <data/creaturescripts/scripts/login.lua:12>
[18/02/2010 14:01:24] Point has logged out.
[18/02/2010 14:01:25] > Broadcasted message: "New record: 1 players are logged in.".
[18/02/2010 14:01:45] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 14:02:46] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 14:03:47] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 14:04:48] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[18/02/2010 14:05:49] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
 
Last edited:
Code:
ALTER TABLE `players`
ADD `onlinetimetoday` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime1` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime2` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime3` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime4` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime5` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime6` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime7` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetimeall` BIGINT( 255 ) NOT NULL DEFAULT '0';
 
Code:
ALTER TABLE `players`
ADD `onlinetimetoday` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime1` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime2` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime3` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime4` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime5` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime6` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetime7` BIGINT( 255 ) NOT NULL DEFAULT '0',
ADD `onlinetimeall` BIGINT( 255 ) NOT NULL DEFAULT '0';

Emm... Error from DB
MySQL zwrócił komunikat:
#1060 - Duplicate column name 'onlinetimetoday'
 
I eliminate this bug by change login.lua from this one :

PHP:
-- CONFIG --
SHOP_MSG_TYPE = 27

SQL_interval = 30

local config = {
    loginMessage = getConfigValue('loginMessage')
}
-- END OF CONFIG --

SQL_COMUNICATION_INTERVAL = SQL_interval * 1000
function onLogin(cid)
    if(InitShopComunication == 0) then
        local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {})
        InitShopComunication = eventServ
    end
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

	local auction = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
    if(auction:getDataInt("auction_balance") > 0) then
            doPlayerAddMoney(cid, auction:getDataInt("auction_balance"))
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You sold item on auction, you get " .. auction:getDataInt("auction_balance") .. " gps.")
            db.executeQuery("UPDATE `players` SET `auction_balance` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
            auction:free()
        end
	
    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end
	
	registerCreatureEvent(cid, "Pacccheck")  
    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "GuildMotd")
    registerCreatureEvent(cid, "Idle")
    registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "onPrepareDeath")
	registerCreatureEvent(cid, "advance")
    registerCreatureEvent(cid, "ArenaKill")
	registerCreatureEvent(cid, "QuestMonster")
	registerCreatureEvent(cid, "PlayerDeath")
    registerCreatureEvent(cid, "WarAttack")
    registerCreatureEvent(cid, "WarKill")
	registerCreatureEvent(cid, "demonOakLogout")
	registerCreatureEvent(cid, "demonOakDeath")
	registerCreatureEvent(cid, "levelUp")
	registerCreatureEvent(cid, "PVPMode")
    registerCreatureEvent(cid, "repKill")  
    registerCreatureEvent(cid, "repLook")  
    registerCreatureEvent(cid, "repDeath")
    registerCreatureEvent(cid, "repMonster")
	registerCreatureEvent(cid, "Killb")
	registerCreatureEvent(cid, "BountyHunter")
	registerCreatureEvent(cid, "DeathBroadcast")

    return TRUE
end

function sql_communication(parameters)
    local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
    if(result_plr:getID() ~= -1) then
        while(true) do
            id = tonumber(result_plr:getDataInt("id"))
            action = tostring(result_plr:getDataString("action"))
            delete = tonumber(result_plr:getDataInt("delete_it"))
            cid = getPlayerByName(tostring(result_plr:getDataString("name")))
            if isPlayer(cid) == TRUE then
                if action == 'give_item' then
                    local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
                    local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
                    local container_id = tonumber(result_plr:getDataInt("param3"))
                    local container_count = tonumber(result_plr:getDataInt("param4"))
                    local add_item_type = tostring(result_plr:getDataString("param5"))
                    local add_item_name = tostring(result_plr:getDataString("param6"))
                    local b_head_slot = getPlayerSlotItem(cid, 1)
                    local b_necklace_slot = getPlayerSlotItem(cid, 2)
                    local b_backpack_slot = getPlayerSlotItem(cid, 3)
                    local b_armor_slot = getPlayerSlotItem(cid, 4)
                    local b_right_hand = getPlayerSlotItem(cid, 5)
                    local b_left_hand = getPlayerSlotItem(cid, 6)
                    local b_legs_slot = getPlayerSlotItem(cid, 7)
                    local b_feet_slot = getPlayerSlotItem(cid, 8)
                    local b_ring_slot = getPlayerSlotItem(cid, 9)
                    local b_arrow_slot = getPlayerSlotItem(cid, 10)
                    if b_arrow_slot.itemid == 0 or (b_left_hand.itemid == 0 and b_right_hand.itemid == 0) then
                        local full_weight = 0
                        if add_item_type == 'container' then
                            container_weight = getItemWeightById(container_id, 1)
                            items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
                            full_weight = items_weight + container_weight
                        else
                            full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                        end
                        local free_cap = getPlayerFreeCap(cid)
                        if full_weight <= free_cap then
                            if add_item_type == 'container' then
                                local new_container = doCreateItemEx(container_id)
                                local iter = 0
                                while iter ~= container_count do
                                doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
                                    iter = iter + 1
                                end
                                doPlayerAddItemEx(cid, new_container)
                                itemtogive_id = container_id
                            else
                                local addeditem = doPlayerAddItem(cid, itemtogive_id, itemtogive_count)
                            end
                            local head_slot = getPlayerSlotItem(cid, 1)
                            local necklace_slot = getPlayerSlotItem(cid, 2)
                            local backpack_slot = getPlayerSlotItem(cid, 3)
                            local armor_slot = getPlayerSlotItem(cid, 4)
                            local right_hand = getPlayerSlotItem(cid, 5)
                            local left_hand = getPlayerSlotItem(cid, 6)
                            local legs_slot = getPlayerSlotItem(cid, 7)
                            local feet_slot = getPlayerSlotItem(cid, 8)
                            local ring_slot = getPlayerSlotItem(cid, 9)
                            local arrow_slot = getPlayerSlotItem(cid, 10)
                            if ring_slot.itemid == itemtogive_id or feet_slot.itemid == itemtogive_id or legs_slot.itemid == itemtogive_id or armor_slot.itemid == itemtogive_id or necklace_slot.itemid == itemtogive_id or head_slot.itemid == itemtogive_id or arrow_slot.itemid == itemtogive_id or left_hand.itemid == itemtogive_id or right_hand.itemid == itemtogive_id or backpack_slot.itemid == itemtogive_id then
                                if b_ring_slot.uid ~= ring_slot.uid or b_feet_slot.uid ~= feet_slot.uid or b_legs_slot.uid ~= legs_slot.uid or b_armor_slot.uid ~= armor_slot.uid or b_necklace_slot.uid ~= necklace_slot.uid or b_head_slot.uid ~= head_slot.uid or b_backpack_slot.uid ~= backpack_slot.uid or b_right_hand.uid ~= right_hand.uid or b_left_hand.uid ~= left_hand.uid or b_arrow_slot.uid ~= arrow_slot.uid then
                                doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Feragon Online shop. You should re-login now to become sure your new item will not disappear if any error occur.')
                                db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                                db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                                else
                                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Feragon Online shop not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'')
                                end
                            else
                                doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Feragon Online shop not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'')
                            end
                        else
                            doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Feragon Online shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot or give to friend and wait about '.. SQL_interval ..' seconds to get it.')
                        end
                        
                        
                    else
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Feragon Online shop is waiting for you. Please take items from both hands or item from arrow slot and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                end
            end
            if not(result_plr:next()) then
                break
            end
        end
        result_plr:free()
    end
    local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
end

To this simple one :

PHP:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "PlayerDeath")
	registerCreatureEvent(cid, "advance")
	registerCreatureEvent(cid, "ArenaKill")
	registerCreatureEvent(cid, "demonOakLogout")
	registerCreatureEvent(cid, "demonOakDeath")
    registerCreatureEvent(cid, "KillingInTheNameOf")
	registerCreatureEvent(cid, "expRate")	  
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena
	
	return true
end

But it's not a anwer. There is lot of think's what I want to have in my server. What's wrong?


/// NEW ERRORS :

[18/02/2010 14:36:51] mysql_real_query(): SELECT `house_id`, `player_id`, `bid` FROM `house_auctions` WHERE `endtime` < 1266500211 - MYSQL ERROR: Table 'unitra1.house_auctions' doesn't exist (1146)
[18/02/2010 14:36:51] > Houses synchronization time: 2.469 seconds.
[18/02/2010 14:36:51] [Warning - IOMapSerialize::loadItems] NULL item at ( 33215 / 31875 / 005 ) (type = 1721, sid = 1, pid = 0)
[18/02/2010 14:36:51] [Warning - IOMapSerialize::loadItems] NULL item at ( 33215 / 31876 / 005 ) (type = 1722, sid = 1, pid = 0)
[18/02/2010 14:36:51] [Warning - IOMapSerialize::loadItems] NULL item at ( 33215 / 31877 / 005 ) (type = 1723, sid = 1, pid = 0)
[18/02/2010 14:36:51] [Warning - IOMapSerialize::loadItems] NULL item at ( 33232 / 31874 / 006 ) (type = 1718, sid = 1, pid = 0)
[18/02/2010 14:36:51] [Warning - IOMapSerialize::loadItems] NULL item at ( 33233 / 31874 / 006 ) (type = 1719, sid = 1, pid = 0)
[18/02/2010 14:36:51] [Warning - IOMapSerialize::loadItems] NULL item at ( 33234 / 31874 / 006 ) (type = 1720, sid = 1, pid = 0)
 
Last edited:
New error :

[18/02/2010 16:10:02] mysql_real_query(): SELECT `house_id`, `player_id`, `bid` FROM `house_auctions` WHERE `endtime` < 1266505802 - MYSQL ERROR: Table 'unitra1.house_auctions' doesn't exist (1146)

Only this one I have got now. I raported other post to delete. So any idea?
 
PHP:
CREATE TABLE `house_auctions`
(
	`house_id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
	`player_id` INT NOT NULL,
	`bid` INT UNSIGNED NOT NULL DEFAULT 0,
	`limit` INT UNSIGNED NOT NULL DEFAULT 0,
	`endtime` BIGINT UNSIGNED NOT NULL DEFAULT 0,
	UNIQUE (`house_id`, `world_id`),
	FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE,
	FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
 
PHP:
Mistake

SQL query:

CREATE TABLE `house_auctions` (
house_id `` INT NOT NULL,
world_id `` TINYINT (2) UNSIGNED NOT NULL DEFAULT 0,
player_id `` INT NOT NULL,
`bid` INT UNSIGNED NOT NULL DEFAULT 0,
`limit` INT UNSIGNED NOT NULL DEFAULT 0,
Endtime `` BIGINT UNSIGNED NOT NULL DEFAULT 0,
UNIQUE (
`` house_id,
`` world_id
)
FOREIGN KEY ( `house_id`, `world_id`) REFERENCES `houses` ( `id`, `world_id`) ON DELETE CASCADE,
FOREIGN KEY ( `player_id`) REFERENCES `players` ( `id`) ON DELETE CASCADE
) ENGINE = MyISAM


MySQL returned:
# 1005 - Can not create table '. \ Unitra1 \ house_auctions.frm' (errno: 150)

// Its tranlsated.

Corect version :

PHP:
Błąd

zapytanie SQL: 

CREATE TABLE `house_auctions` (
`house_id` INT UNSIGNED NOT NULL ,
`world_id` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT 0,
`player_id` INT NOT NULL ,
`bid` INT UNSIGNED NOT NULL DEFAULT 0,
`limit` INT UNSIGNED NOT NULL DEFAULT 0,
`endtime` BIGINT UNSIGNED NOT NULL DEFAULT 0,
UNIQUE (
`house_id` ,
`world_id` 
),
FOREIGN KEY ( `house_id` , `world_id` ) REFERENCES `houses` ( `id` , `world_id` ) ON DELETE CASCADE ,
FOREIGN KEY ( `player_id` ) REFERENCES `players` ( `id` ) ON DELETE CASCADE 
) ENGINE = InnoDB 


MySQL zwrócił komunikat:  
#1005 - Can't create table '.\unitra1\house_auctions.frm' (errno: 150)
 
[resolved here]

i used:

CREATE TABLE `house_auctions` (
`house_id` INTEGER NOT NULL,
`world_id` INTEGER NOT NULL DEFAULT 0,
`player_id` INTEGER NOT NULL,
`bid` INTEGER NOT NULL DEFAULT 0,
`limit` INTEGER NOT NULL DEFAULT 0,
`endtime` INTEGER NOT NULL DEFAULT 0)
 
Code:
[19/02/2010 19:08:53] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[19/02/2010 19:09:54] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[19/02/2010 19:10:55] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[19/02/2010 19:11:56] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[19/02/2010 19:12:57] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[19/02/2010 19:13:58] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)

New error. Big issue :/
 
Code:
[20/02/2010 12:27:31] mysql_real_query(): UPDATE `players` SET `onlinetime7`=players.onlinetime6, `onlinetime6`=players.onlinetime5, `onlinetime5`=players.onlinetime4, `onlinetime4`=players.onlinetime3, `onlinetime3`=players.onlinetime2, `onlinetime2`=players.onlinetime1, `onlinetime1`=players.onlinetimetoday, `onlinetimetoday`=0; - MYSQL ERROR: Unknown column 'onlinetime7' in 'field list' (1054)
[20/02/2010 12:27:31] mysql_real_query(): UPDATE `players` SET `exphist7`=players.exphist6, `exphist6`=players.exphist5, `exphist5`=players.exphist4, `exphist4`=players.exphist3, `exphist3`=players.exphist2, `exphist2`=players.exphist1, `exphist1`=players.experience-players.exphist_lastexp, `exphist_lastexp`=players.experience; - MYSQL ERROR: Unknown column 'exphist7' in 'field list' (1054)
[20/02/2010 12:27:31] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[20/02/2010 12:28:32] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[20/02/2010 12:29:33] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[20/02/2010 12:30:34] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)
[20/02/2010 12:31:35] mysql_real_query(): UPDATE `players` SET `onlinetimetoday`=players.onlinetimetoday+60, `onlinetimeall`=players.onlinetimeall+60 WHERE `online` = 1; - MYSQL ERROR: Unknown column 'onlinetimetoday' in 'field list' (1054)

What is going on ? ;/
 
Back
Top