matilda002 / FollowTheLight

1 stars 0 forks source link

Player: HP UPDATE #44

Open lwcsharp opened 7 months ago

lwcsharp commented 7 months ago

create update query > calculate hp + effect

create method who holds the update-function AND pick correct player

implement it into server: call for the method after each chosen choice?

lwcsharp commented 7 months ago

UPDATE players SET hp = hp +( SELECT effect FROM storypaths JOIN players USING(storypath_id) WHERE username = 'test' ) WHERE username = 'test';

Needs adjustment...hp value vanished in players table....

lwcsharp commented 7 months ago

new query: works in pgAdmin

UPDATE players SET hp = hp + COALESCE( (SELECT effect FROM storypaths WHERE storypath_id = 3)) WHERE username = 'test';