Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 04:18

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



how to store SELECT values from DB in Variable

Discussion on how to store SELECT values from DB in Variable within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2017
Posts: 1
Received Thanks: 0
how to store SELECT values from DB in Variable

hi

i hope to find help here

am facing a problem with retrieving some data from my DB with SELECT query

am doing a Quest that needs to check Pet level before updating its parameters

the new_petsystem table in DB looks like

Code:
 id  | name | level | evolution | exp | expi | bonus0 | bonus1 | bonus2 | skill0 |skill0lv etc
now when i UPDATE parameters it works fine no problem

like this :

Code:
 mysql_direct_query(string.format("UPDATE player.new_petsystem SET level = 82, evolution = 3, exp = 0, expi = 0, bonus0 = 95, bonus1 = 95, bonus2 = 95 WHERE id = %d;", item.get_id()));
but when i try to retrieve pet level and store it in variable
i trid many ways like "

Code:
 local lvlCheck =  mysql_direct_query("SELECT level FROM player.new_petsystem WHERE id =  "..item.get_id().."; ")
then i try to show what was stored in variable like :
Code:
 syschat(" result is : "..lvlCheck.." ")
it doesnt work .. i tried many ways but no luck
some times it shows me nil result . some times it shows me some big number that i dont know where it came from

hope if any one can help me of the right way to retrieve values from DB and store it in a variable to use it in my quest


thanks in advance
torce is offline  
Reply


Similar Threads Similar Threads
Variable in Variable
08/09/2016 - AutoIt - 2 Replies
Ich habe ein kleines Problem. Ich bin neu in AutoIt. mein Problem ist folgendes: Ich will in einer Variable einen Path speicher: $NameVar = C:\Users\ Das ist kein Problem. Aber hinter "C:\Users\" soll jetzt aus einer anderen Variable ein Ordner Name genommen werden. Also in etwa: $NameVar = Ordner2 $PathVar = C:\Users\ $NameVar nur so geht das ja nicht ganz ... was kann ich machen? Die Idee dahinter ist das er einen Ordner mit DirCopy() mehrfach erstellt im gleichen Ordner mit...
Cost of accessing a casted variable vs. assigning the casted variable? (C#)
01/05/2011 - CO2 Programming - 5 Replies
I know that in unmanaged C++, casting is at compile-time, so it's better to avoid the assignment and simply access it for all instances. However, in C#, I have no idea since I'm pretty new to it.
Überprüfen ob Variable Eine Variable ist
10/16/2010 - AutoIt - 26 Replies
Hey leute ich wollte fragen ob/wie man überprüfen kann ob eine Variable eine Variable ist z.b. so $k = 1 $i = $k if $i = VARIABLE Then msgbox(0,'$i ist eine variable!!','') endif PS:Wp releast man nochma TuT (z.b. für metin2??)



All times are GMT +1. The time now is 04:18.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.