how use to skript-db item type

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

daniel24

Member
Sep 21, 2022
3
0
1
28
Code:
function getitemname(p:player, t:item):
  execute "select `itemname` from `getitemname` where `itemtype` = '%{_t}%' Limit 1" in {-sql} and store the result in {_return::*}
  message "%{_return::itemname::1}%" to {_p}
  message "%{_t}%" to {_p}

skript-db
I want to read the DB in the query by recognizing the item type, translate it, and print it out.

{_t} has a good block type
Why does {_return:itemname::1} appear as a null value...

In MySQL,
Code:
select `itemname` from `getitemname` where `itemtype` = 'dirt' Limit 1
If you type it, it comes out well as translated soil.

I ask for your help
 
Because 'execute' effect in skript-db is asynchronius, you need make 'delayed effect' with skript-reflect or use sync method.
 
Status
Not open for further replies.