skript-db insert error

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

MrNygus

Active Member
Jan 28, 2017
116
2
18
26
I have problem with insert data to mysql db. Select works but insert do nothing:

Code:
       execute "select * from konta" in {sql} and store the result in {_resultat::*}
        send {_resultat::nick::*}
        execute "insert into konta ( nick , password ) values ( testowy , dwa ) " in {sql}
[doublepost=1628273712,1628272530][/doublepost]Solved by: execute "INSERT INTO `konta` (`nick`, `password`) VALUES ('Hej5', 'Hej5')" in {sql}
 
ok...
that doesn't work again:
execute "INSERT INTO `konta` (`nick`, `password`) VALUES ('%player's name%', ""%{_hash}%"")" in {sql}
in mysql, password is varchar(350), hash has 64 chars. What's wrong? using only %player's name% doesnt work too
 
I only test other options. Using '%smth%' show warn to not use it in this site. I hash password with sha-256 plus salt.
 
that's works:
execute "INSERT INTO `konta` (`nick`, `password`) VALUES ('Sam', 'haselko')" in {sql}
but this is not:
set {_nick} to player's name
execute "INSERT INTO `konta` (`nick`, `password`) VALUES ('%{_nick}%', 'haselko')" in {sql}
 
Status
Not open for further replies.