Variable in UPDATE #4

Closed
opened 2021-04-05 01:20:53 +00:00 by Envqu · 1 comment
Envqu commented 2021-04-05 01:20:53 +00:00 (Migrated from github.com)

Hi.
Why Variables in Update not working?

It works:

execute "UPDATE stats SET level = %{_level}%, xp = %{_xp}% WHERE nick = 'Player123'" in {sql}

But not this:
execute "UPDATE stats SET level = %{_level}%, xp = %{_xp}% WHERE nick = %player's nickname%" in {sql}

I also tried:

set {_p} to player's nickname
and WHERE nick = %{_p}%" in {sql}

%player% gives error: "Parameter cannot be serialized: org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer

WHERE nick = '%{_p}%'" in {sql} gives error: Could not set parameter at position 3 (values was 'Player123')

Hi. Why Variables in Update not working? It works: execute "UPDATE `stats` SET `level` = %{_level}%, xp = %{_xp}% WHERE `nick` = 'Player123'" in {sql} But not this: execute "UPDATE `stats` SET `level` = %{_level}%, xp = %{_xp}% WHERE `nick` = %player's nickname%" in {sql} I also tried: set {_p} to player's nickname and WHERE `nick` = %{_p}%" in {sql} %player% gives error: "Parameter cannot be serialized: org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer WHERE `nick` = '%{_p}%'" in {sql} gives error: Could not set parameter at position 3 (values was 'Player123')
GovindasOM commented 2021-04-05 08:17:42 +00:00 (Migrated from github.com)

try name of player

try name of player
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Limework/skript-db#4
No description provided.