SQL query for slider bar

Hello everyone,

I would like to use a slider bar as a progression bar, for gaining some levels. In my database, I have two components : a “XP” number and a “Nextlevel” number, to know when to upgrade the level. But I fail to make a correct query : I wrote :

SELECT (XP*1.0)/(Nextlevel) FROM data LIMIT 0, -1

The *1.0 part is to force the query to have a real number instead of an integer. And it gives me the correct values :
image

But when I connect the query to the slider, the slider doesn’t adjust to the value :
image

Does the slider just can’t accept complex queries ? It works with simple queries (like if I had a field “progress” it would work). Or where am I wrong ?

Thanks for your help

Ok, so if I understand well, I can’t make a query for the sliders ? I have to make a field in my database to have the progression of the XP… I tried this, but it doesn’t work very well. Too many actions in the process, some actions are missed.


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.