Thread Rating:
- 0 Votes - 0 Average
- 1
- 2
- 3
- 4
- 5
mySQL problem - db.row
|
Author |
Message |
Eledrianek
Apprentice
Posts: 21
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2014
Reputation: 0
|
mySQL problem - db.row
Hi,
can anyone help me with little mysql problem?
This works:
Code:
DB.QUERY "SELECT COUNT(*) FROM kelevar_quests_stats"
local.kolik=<db.row.0>
FOR <local.kolik>
DB.QUERY "SELECT prijato FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
local.prijato=<db.row.0>
DB.QUERY "SELECT splneno FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
local.splneno=<db.row.0>
DB.QUERY "SELECT preruseno FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
local.preruseno=<db.row.0>
DB.QUERY "SELECT ID_questu FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
DB.QUERY "SELECT * FROM kelevar_quests_stats WHERE id='<dlocal._for>'"
But this one not (it result to debug and show only db.row.1)
Code:
local.name=<DEF.QUEST_<argn1>_NAMELOCALIZED>
DB.QUERY "SELECT COUNT(*) FROM kelevar_quests_stats"
local.kolik=<db.row.0>
FOR <local.kolik>
DB.QUERY "SELECT * FROM kelevar_quests_stats WHERE id='<dlocal._for>'"
dtext 95 <eval 60+(<dlocal._for>*20)> 88 <def.quest_<db.row.1>_namelocalized>
dtext 370 <eval 60+(<dlocal._for>*20)> 44 <db.row.2>
dtext 430 <eval 60+(<dlocal._for>*20)> 44 <db.row.3>
dtext 490 <eval 60+(<dlocal._for>*20)> 44 <db.row.4>
local.x +=1
endfor
This shorter code results to this:
Code:
04:57:DEBUG:__ thread (3048) __ | # | _____ function _____________ | ticks passed from previous function start ______
04:57:DEBUG:>> 3048 | 0 | NetworkManager::processAllInput | +0
04:57:DEBUG:>> 3048 | 1 | NetworkInput::processInput | +0
04:57:DEBUG:>> 3048 | 2 | NetworkInput::processData | +0
04:57:DEBUG:>> 3048 | 3 | NetworkInput::processData | +0
04:57:DEBUG:>> 3048 | 4 | NetworkInput::processGameClientData | +0
04:57:DEBUG:>> 3048 | 5 | PacketGumpDialogRet::onReceive | +0
04:57:DEBUG:>> 3048 | 6 | CClient::Dialog_OnButton | +0
04:57:DEBUG:>> 3048 | 7 | CScriptObj::OnTriggerRunVal | +0
04:57:DEBUG:>> 3048 | 8 | CScriptObj::OnTriggerRun | +0
04:57:DEBUG:>> 3048 | 9 | CChar::r_Verb | +0
04:57:DEBUG:>> 3048 | 10 | CObjBase::r_Verb | +0
04:57:DEBUG:>> 3048 | 11 | CClient::Dialog_Setup | +0
04:57:DEBUG:>> 3048 | 12 | CDialogDef::GumpSetup | +0
04:57:DEBUG:>> 3048 | 13 | CScriptObj::OnTriggerRunVal | +0
04:57:DEBUG:>> 3048 | 14 | CScriptObj::OnTriggerRun | +0
04:57:DEBUG:>> 3048 | 15 | CScriptObj::OnTriggerRun | +0
04:57:DEBUG:>> 3048 | 16 | CScriptObj::OnTriggerForLoop | +16
04:57:DEBUG:>> 3048 | 17 | CScriptObj::OnTriggerRun | +1719
04:57:DEBUG:>> 3048 | 18 | CDialogDef::r_Verb | +0
04:57:DEBUG:>> 3048 | 19 | CChar::r_Verb | +0
04:57:DEBUG:>> 3048 | 20 | CObjBase::r_Verb | +47
04:57:DEBUG:>> 3048 | 21 | CScriptObj::r_Verb | +0 <-- exception catch point (below is guessed and could be incorrect!)
04:57:DEBUG:>> 3048 | 22 | CGFile::Close | +0
04:57:DEBUG:command 'DB.QUERY' args '"SELECT * FROM kelevar_quests_stats WHERE id='20'' [231AF63C]
How this thing works? Is it possible to extract all information from the mySQL table? Thanks for any help...
(This post was last modified: 09-11-2014 01:00 PM by Eledrianek.)
|
|
09-11-2014 12:57 PM |
|
|
Extreme
Grandmaster Poster
Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20
SphereCommunity
|
|
09-11-2014 02:36 PM |
|
|
Eledrianek
Apprentice
Posts: 21
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2014
Reputation: 0
|
RE: mySQL problem - db.row
This is the screen of my table kelevar_quests_stats. MySQL access and reading column just one by one (im able to access to the data from "ID_questu" "prijato" etc but not all in one QUERY.
Is there a way how sphere could read whole this table and use its informations in the script?
Or I must use scp like this, with multiple QUERIES:
Code:
//DB.QUERY "SELECT prijato FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
//local.prijato=<db.row.0>
//DB.QUERY "SELECT splneno FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
//local.splneno=<db.row.0>
//DB.QUERY "SELECT preruseno FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
//local.preruseno=<db.row.0>
//DB.QUERY "SELECT ID_questu FROM kelevar_quests_stats WHERE ID='<dlocal._for>'"
|
|
09-11-2014 09:00 PM |
|
|
User(s) browsing this thread: 3 Guest(s)