[Skellet] getting specific MySQL value

  • 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 community!

    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.

FleecyTeddy

Member
Jan 26, 2017
4
0
0
Hey
I'm currently working on a settings menu for my bungeecord server. All (important) values are stored on a mysql server. So, I need my script to connect to the mysql server (which works) and get the values, I will need for my script to work (which is not working as I expected)... So, here's what I got already:
code_language.skript:
on script load:
    connect to mysql
   
command /test:  
    trigger:
        set {_test} to mysql result of query "SELECT player_id FROM fr_players WHERE player_name=""{_player}%"" limit 1"
        broadcast "%{_test}%"

But it's just giving me something like com.mysql.jdbc.JDBC4ResultSet@22e847b0...

Here's the structure of the table:

code_language.skript:
%YAML 1.1
---
# serpix.fr_players
- #First column. I need the player_id value, which I tried to get by searching the player_name first.
  player_id: 1
  player_name: "FleecyTeddy"
  player_uuid: "66cf7490-9090-4af4-8035-bf35078269df"
  last_online: "2017-08-06 15:47:32"
...
 
Last edited:
Hey
I'm currently working on a settings menu for my bungeecord server. All (important) values are stored on a mysql server. So, I need my script to connect to the mysql server (which works) and get the values, I will need for my script to work (which is not working as I expected)... So, here's what I got already:
code_language.skript:
on script load:
    connect to mysql
  
command /test: 
    trigger:
        set {_test} to mysql result of query "SELECT player_id FROM fr_players WHERE player_name=""{_player}%"" limit 1"
        broadcast "%{_test}%"

But it's just giving me something like com.mysql.jdbc.JDBC4ResultSet@22e847b0...

Here's the structure of the table:

code_language.skript:
%YAML 1.1
---
# serpix.fr_players
- #First column. I need the player_id value, which I tried to get by searching the player_name first.
  player_id: 1
  player_name: "FleecyTeddy"
  player_uuid: "66cf7490-9090-4af4-8035-bf35078269df"
  last_online: "2017-08-06 15:47:32"
...
Perhaps you can find the expressions you need here
 
Hey
I'm currently working on a settings menu for my bungeecord server. All (important) values are stored on a mysql server. So, I need my script to connect to the mysql server (which works) and get the values, I will need for my script to work (which is not working as I expected)... So, here's what I got already:
code_language.skript:
on script load:
    connect to mysql
  
command /test: 
    trigger:
        set {_test} to mysql result of query "SELECT player_id FROM fr_players WHERE player_name=""{_player}%"" limit 1"
        broadcast "%{_test}%"

But it's just giving me something like com.mysql.jdbc.JDBC4ResultSet@22e847b0...

Here's the structure of the table:

code_language.skript:
%YAML 1.1
---
# serpix.fr_players
- #First column. I need the player_id value, which I tried to get by searching the player_name first.
  player_id: 1
  player_name: "FleecyTeddy"
  player_uuid: "66cf7490-9090-4af4-8035-bf35078269df"
  last_online: "2017-08-06 15:47:32"
...
Two words, sql injection
 
Status
Not open for further replies.