Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

beardbar
Tuesday, July 17th, 2007 at 1:09:06am MDT 

  1. I am trying to wrap my head around the best way to write a query for the following circumstances I know it should be easy but i get very confused when it comes to less then and greater thens.
  2.  
  3. I have 1 table that contains the following columns
  4.  
  5. rank_id, rank_title, rank_min, rank_image
  6.  
  7. I have a variable $postCount
  8.  
  9. I need a query that will take my post count, and compare it to the returned results and pull the correct row of which the postCount falls into.
  10. rank_min is the ranks post count minium. example
  11.  
  12. rank 1 = 10 posts
  13. rank 2 = 20 posts
  14. rank 3 = 30 posts
  15.  
  16. if my user has 22 posts, the query should return rank 2. if my user has 31 posts it should return rank 3.
  17.  
  18. so far i have
  19.  
  20. $database->setQuery("SELECT * FROM fb_ranks WHERE rank_min >= '$postCount'");

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation