Okay here's my table structure ,
Name: reward
structure: title , point , hasimg , imgurl
I want to do is , get the title and imgurl(if hasimg=1) when user has points equal to/more than a specific amount.
Here's an example.
the reward table is filled with these values(according to above sequence):
1st row: ace , 1000 , 1 , http://imglink.com
2nd row: elite , 2000 , 0 , none
3rd row: pro , 3000 , 1 , http://imglink.com
A user has 3258 points , which is more than 3000 , so he will have the title "pro".
So how can i use mysql query to select the "pro" and the imgurl(because hasimg=1) and store them in php variables?
if a user has 2450 points , which is more than 2000 , so he will have the title "2000" , however , it only gets the title but not get the imgurl as hasimg=0.
And how can i make sure the query dosent select 1000 and 2000 as 3000 is more than them?