I have this code: $sql = 'SELECT ref, name, pic, id, count, real_count, out, real_out FROM links ORDER BY count DESC LIMIT '.$config['display_num']; Code (markup): I would like it to select them WHERE my field 'count' is a number more than 5. Can i do this, anyone know what i need to add? I use this script for top referrers list on my site, i only want referrers to show who have sent me 5 hits you see...
Try: $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']; Code (markup):
Can anybody else help me with this one then? I'd like it to select WHERE the number in the field 'count' is no more than 20 less than the number in my field 'out' - so if i've sent them alot more traffic than they've sent me, i want to stop displaying their link when i send them 20 more hits than they've sent me. Anybody know how i could do this? Appreciate the help.
Try this: $sql = 'SELECT ref, name, pic, id, count, real_count, out, real_out FROM links WHERE count > 5 OR Count =< 20 ORDER BY count DESC LIMIT '.$config['display_num']; Code (markup):
Can anybody with these, please? I really need it. Don't want to show sites that have sent me 30 hits less than i've sent them.
Try this: Code: $sql = 'SELECT ref, name, pic, id, count, real_count, out, real_out FROM links WHERE count > 5 and Count =< 20 ORDER BY count DESC LIMIT '.$config['display_num'];
Hi, Try for this $sql = 'SELECT ref, name, pic, id, count, real_count, out, real_out FROM links ORDER BY count>=5 DESC LIMIT '.$config['display_num'];