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

[Help]Get value from MySQL database

Zikerus

Nutria Developer
Joined
Mar 13, 2008
Messages
193
Reaction score
0
Location
Poole, UK
Hello everyone, I am doing system for my server and I stuck with one thing. I need to get value from database, I added to player_items and Player_depoitems something like description (unique for item), how can I read that from database to my description (This one when u look on item - "You see bla bla bla.") I know how to put that in desc, but not really know how to get this value, I guess there is function needed. Cheers for help.

P.S. I tried to base it on item count taken from database but I can't find function responsible for that :/ (You know - "You see 6 eggs" <- the 6 is taken from db I think or stored in memory) So how to read this from db and write in memory or however to make it working.

@edit2
I think I found something
Code:
ItemMap itemMap;
	query.str("");
	query << "SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_items` WHERE `player_id` = " << player->getGUID() << " ORDER BY `sid` DESC";
	if((result = db->storeQuery(query.str())))
Am I on right way?:>

@EDIT3

Problem solved ;p I am proud of myself :p
 
Last edited:
Back
Top