Mysql check

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

helomi

Member
Feb 9, 2017
18
0
0
24
Hi, i try 2 hours create simple mysql row check, but dont work :/

I tried something like this:
Code:
On join:
   set {_check-%player%} to mysql result of query "SELECT Breaks_cobble FROM Stats_SB_Player WHERE 'Player' = '%player%'"
   if {_check-%player%} is not "%player%":
       ....

I need simple table check if player have row in table.
 
code_language.skript:
function check(tbl: text, c: text, w: text) :: boolean:
     set {_result} to mysql result of query "SELECT %{_c}% FROM %{_tbl}% %{_w}%"
     set {_rc::*} to mysql object "%{_c}%" in {_result}
     if {_rc::*} is not set:
          set {_return} to false
     else:
          set {_return} to true
     return {_return}
code_language.skript:
if check("tableName", "Player", "WHERE Player='%{_p}%'") is true:
and get object
code_language.skript:
function get(tbl: text, c: text, w: text) :: objects:
     set {_result} to mysql result of query "SELECT %{_c}% FROM %{_tbl}% %{_w}%"
     set {_rt::*} to mysql object "%{_c}%" in {_result}
     return {_rt::*}
 
Last edited by a moderator:
Status
Not open for further replies.