Jump to content

[Help] toJSON/fromJSON


Tekken

Recommended Posts

Posted

HI, i need some help on toJSON and fromJSON.

My problem is this:

I save ID, NUMBER like this:

local json = toJSON({ ID, NR }) 

Everything work's ok but I need to save like 20 ID's and 20NR's but each time will overwrite the old ID/NR and I don't want that...

Any help ?

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted

I can't show my full code but

SAVE

local theID = getElementModel(element) 
local thenr = getElementHealth(element) 
local json = toJSON({theID, theNr}) 
--- Bla, bla 
dbQuery(db, "INSERT INTO table(json) VALUE(?)", json) 

LOAD

local theID, theNr = unpack(fromJSON(json)) 

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted
you used INSERT not UPDATE

so nothing will be rewrited

Yes but will still overwrite the old values...

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted

Do you know how to/fromJSON work's ? when i send that data in THE SAME json will OVERRITE old data! and keep only the last one.

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted

Do you know how to/fromJSON work's ? when i send that data in THE SAME json will OVERRITE old data! and keep only the last one.

Man you are inserting new values every time did you tired :

dbExec(db, "UPDATE table(json) SET value = ? WHERE yourData = ?", json) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Do you know how to/fromJSON work's ? when i send that data in THE SAME json will OVERRITE old data! and keep only the last one.

Man you are inserting new values every time did you tired :

dbExec(db, "UPDATE table(json) SET value = ? WHERE yourData = ?", json) 

this will just give NULL.

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted (edited)
dbExec(db, "UPDATE table(json) SET value = ? WHERE yourData = ?", json) 

this will just give NULL.

maybe you did something wrong that's why i asked you to show me your code.

Edited by Guest

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Everything works ok only that thing, and i think that's normal, I came here because i thought somebody will give me a better idea.

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted
How we can help you if you dont want to show us your full codes? and the way that you reply us is so rude

I was a bit angry because i have some problems, but you didn't want to understand.

Resources I made:

Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!

 

Posted
How we can help you if you dont want to show us your full codes? and the way that you reply us is so rude

I was a bit angry because i have some problems, but you didn't want to understand.

Bro how we suppose to know what is creating problem, you need to show us your full code because it's the only one solution.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...