| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Straight from Sweden | count ip numbers to specific member. Heya all im in need of some help. Im currently rebuilding my toplist software. I have over 1200 members, each one got a tracker (image) which stores every unique(IP) that visits their blog. the toplist ranks blogs on unique visitors. Now im trying to create a php file which should be executed every 30 minutes to rerank the websites on the toplist. I want this to be so optimized as possible, someone told me about DESTINCT in sql but not sure what he meant. Got two tables one for members and one for unique ips which are set to be unique. Not sure how to build it. Would appreciate if someone could help me. Best Regards Jawn |
| |
| | #2 (permalink) |
![]() | Hey John, DISTINCT is where SQL will grab only 1 of each value in a table, for example: Say we had these entries in a table: 1.0.0.0 1.0.0.0 1.2.0.0 1.0.0.0 1.2.6.3 Using DISTINCT would bring up only these results: 1.0.0.0 1.2.0.0 1.2.6.3 Then you can simply use mysql_num_rows to count the number of results given, hence giving you the number of unique IP's. So, using sql, to get the number of unique IP's could be done like this: PHP Code: Not sure what topsites you're using, so you would have to alter that obviously for it to work. Not sure how you would rerank the sites though, as I haven't bothered looking into how any of the topsites systems work. ![]() All the best, Rhett.
__________________ <?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?> Last edited by BillyConnite; 10-24-2006 at 07:05 PM. |
| |
| | #4 (permalink) | |
![]() | Quote:
__________________ <?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?> | |
| |
| | #6 (permalink) |
| Straight from Sweden | Hey guys thanks for taking the time, this is what i have done so far but i very doubt this is the best/fastest way. $ PHP Code: |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |