Welcome Guest, Not a member yet? Register   Sign In
Filter sql result
#1

[eluser]brian88[/eluser]
Currently I am displaying posts ordering by likes.

1st post - 10 likes and 8 dislikes

2nd post - 8 likes and 1 dislikes

Code:
select *
from posts
order by likes desc

Is there a way to make the "2nd post" display on top of my "1st post" using some sql math or php function.

Im not totally sure on the how I want the posts to display, but if the post has almost as many likes as dislikes I want to make that post drop in rankings.


Messages In This Thread
Filter sql result - by El Forum - 04-03-2012, 10:20 AM
Filter sql result - by El Forum - 04-05-2012, 12:38 PM
Filter sql result - by El Forum - 04-05-2012, 05:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB