NameSilo

[Resolved] Can you help me?

NamecheapNamecheap
Watch

Marty Rogers

Account Closed
Impact
3
Can you help me?

I have this code:

Code:
$sql = 'SELECT ref, name, pic, id, count, real_count, out, real_out FROM links WHERE count > 5
	ORDER BY count DESC LIMIT '.$config['display_num'];
Anybody know how i could select from links WHERE the number in my field 'count' is no more than 20 less than the number in my field 'out'. Basically i don't want to show their links when i've sent them alot more traffic than they've sent me, so i want to stop showing their link when i've sent them 20 hits more than they've sent in to me.

Right now it shows all links that have sent in 5 hits today. I still want it to show them when they've sent 5 hits in, but once i've sent them 20 hits more than they've sent in i want it to stop showing them.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
I have not had a chance to test but I would hazard a guess the following should work.

PHP:
$sql = 'SELECT ref, name, pic, id, count, real_count, out, real_out FROM links WHERE count > 5 AND count < (out - 20)
	ORDER BY count DESC LIMIT '.$config['display_num']
 
Last edited:
0
•••
That didn't work, it gave me an error:

Code:
Parse error: syntax error, unexpected T_VARIABLE in /home/bvb/public_html/myrawr/top-referrers/display.php on line 11
:(
 
0
•••
He just changed the where clause, so that shouldn't give you that error.
 
0
•••
Oh yeh i just tried it again, it works - i did something wrong before. Thanks alot, i really appreciate it.
 
0
•••
Cool glad to have helped, Was not 100% sure if it would work but good that it does.
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Zero Commission
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back