- Joined
- Dec 23, 2014
- Messages
- 2,462
- Solutions
- 68
- Reaction score
- 1,129
I asked about this problem before and did get half of what I needed solved.
I am trying to input/export useable data from my database. I have figured out how to input new data but am having a problem exporting new data...
So I can put values in the database but cant seem to call it out of it.
Here is the function I am using to export.
Is there something I need to do to tell the script whether the data is a string, or number value?
When I use the function the script will read that there is something there, however, I cannot ask it things like:
It wont register it but If I do:
Then the script reads it and accepts that the player does have a value there.
I am trying to input/export useable data from my database. I have figured out how to input new data but am having a problem exporting new data...
So I can put values in the database but cant seem to call it out of it.
Here is the function I am using to export.
Code:
function getPetName(cid)
local resultr, ret = db.storeQuery("SELECT `pet_name` FROM `player_pet` WHERE `player_id` = "..getPlayerGUID(cid)..";")
ret = result.getDataInt(resultr,'pet_name')
result.free(resultr)
return ret
end
Is there something I need to do to tell the script whether the data is a string, or number value?
When I use the function the script will read that there is something there, however, I cannot ask it things like:
Code:
if getPetName(cid) =="name" then
It wont register it but If I do:
Code:
if getPetName(cid) then
Then the script reads it and accepts that the player does have a value there.