Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:13:10+00:00 2026-06-05T02:13:10+00:00

Okay here’s my table structure , Name: reward structure: title , point , hasimg

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:13:13+00:00Added an answer on June 5, 2026 at 2:13 am

    You basically need the highest point record in table that is less than (or equal to) the userPoints
    You can use sql query like the following

    select * from rewards where point <= 2300 order by point desc limit 1
    

    once you have the row you can check whether image bit is set and based on that show image or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, here's the situation: We have a table of about 50 columns (created by
Okay, here is the deal: User's can buy 'gold' inside of the app with
Okay here is what I'm, trying to do I want to escape the period
Okay here is the scenario! I have a Person object which has an Address
Okay, so here is what I'm trying to do. The user inputs a number.
Okay so here's my issue. The user can go onto my site and retrieve
Okay so here's the scenario: User is presented with form that contains file inputs.
Okay, two admissions here, one is I'm sure this question has been answered and
Okay the title may not justify what I'm trying to do here but dont
Okay here's my situation. I have the following branches development development-kirby (270 commits ahead

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.