little coding help

Forum
Last Post
Threads / Messages

Nemesis

Member
Member
Joined
Mar 23, 2011
Messages
641
Points
16
Location
Ohio, United States
Mysidian Dollar
32,178
So for side projects I mess around witch scripts to help myself learn php. I am about finished with this face book 'my likes' site but the script originally has the top likes listed in order by the amount of times the page was viewed. I never really thought about it but a friend i was going to give the site to, to run, wants the top likes to be ordered by actual likes so as no one is to cheat the system by refreshing the page. I checked for a guide already on how to get that information from facebook to store in an sql database but couldn't figure it out. if anyone can help me learn thanks :) and here's what the site looks like http://melikey.net63.net/

so heres the code
Code:
#
<?
#
include('config/db_con.php');
#
mysql_connect("$host", "$username", "$password")or die("cannot connect");
#
mysql_select_db("$db_name")or die("cannot select DB");
#
$top = "SELECT * FROM `like` ORDER BY count DESC LIMIT 0, 100";
#
$new = mysql_query($top) or die(mysql_error());
#
while($rows = mysql_fetch_array($new)){
#
?>
#
<div style="clear:left;">
#
<div style="float:left;">
#
<fb:like layout="button_count" class="like_button" href="<?echo $site;?>like.php?like=<? echo $rows['id']; ?>"></fb:like>
#
</div>
#
<a href="<?echo $site;?>like.php?like=<? echo $rows['id']; ?>"><? echo stripslashes($rows['like']);?></a></div>
#
<?

ok so heres the code and up there you can see where the facebook like button code is <fb>. and you can see how it orders 100 of them in decending order but from the 'like' variable whitch is page views. How can i store the actual amount people hit liked and then retrieve that instead? again thanks for help and i hope i was clear enough:smile:
 
I checked for a guide already on how to get that information from facebook to store in an sql database but couldn't figure it out.

Can you give me the link to the guide you were referring to?
 
oh sorry i actually never found a guide on how to do this. I was hoping someone would know, did you find a guide? if so could you show me it please? and thanks for helping.
 
yeah i came acrossed that. it doesn't seem possible becasue the button is an iframe so that data is on their servers. still other like sites have done it so idk. probably to much work..

thanks for trying though
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,129
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top