henry900326

Untitled

Oct 19th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. Function GetTextValue(uuid:text, n:text, sql:text) :: text:
  2. set {_result} to mysql result of query "SELECT `testuuid`,`testinsql` FROM %{_sql}% WHERE `testuuid` = '%{_uuid}%'"
  3. set {_result::*} to mysql string "%{_n}%" in {_result}
  4. return "%{_result::*}%"
  5.  
  6. #SELECT `欄位` FROM `資料表` WHERE `特定欄位` LIKE 字串 ;
  7.  
  8. #一般用法: SELECT `id`,`name` FROM `table` WHERE `name` LIKE 'admin' ;
  9. #Function GetNumberValue(p:player, n:text) :: number:
  10.  
  11.  
  12. command /123456:
  13. trigger:
  14. set {_result} to mysql result of query "SELECT * FROM testsql"
  15. set {_testinsql::*} to mysql string "testinsql" in {_result}
  16. set {_testuuid::*} to mysql string "testuuid" in {_result}
  17. send "testinsql: %{_testinsql::*}%" to player
  18. send "testuuid: %{_testuuid::*}%" to player
  19.  
  20. command /test1:
  21. trigger:
  22. send GetTextValue(uuid of player, "testinsql", "testsql")
  23.  
  24. command /test2:
  25. trigger:
  26. send GetTextValue(uuid of player, "testuuid", "testsql")
  27.  
  28. command /test3:
  29. trigger:
  30. send GetTextValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testinsql", "testsql")
  31.  
  32. command /test4:
  33. trigger:
  34. send GetTextValue("72361866-212A-40B7-B2E7-55EB057FF01E", "testuuid", "testsql")
  35.  
  36. command /87:
  37. trigger:
  38. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`) VALUES ('%uuid of player%','100')"
  39.  
  40. command /9487:
  41. trigger:
  42. mysql update "INSERT INTO testsql (`testuuid`, `testinsql`) VALUES ('72361866-212A-40B7-B2E7-55EB057FF01E','50')"
Advertisement
Add Comment
Please, Sign In to add comment