FatDank
06-14-2011, 11:51 AM
Hi guys. I am in a real pickle here. I am trying to make a website where;
- Anyone can leave a status
- Have the facebook like button on each status
However I cant seem to achieve this. I can get the like button under each status but as soon as one is clicked they are all clicked.
I hope someone can help.
Here is what I have:
<?php
mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$status="SELECT * FROM comments WHERE 'id'";
if ($_GET['$status'] == "$id")
$query="SELECT * FROM comments";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b>Database Output</b><br><br>";
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$comment=mysql_result($result,$i,"post");
echo "<b>($id)</b> $comment<br>";
echo "<div class='fb_like'>
<fb:like width='340' layout='standard' show_faces='false' href='<?php the_permalink(); ?>' colorscheme='default'></fb:like>
</div> <br><hr>";
$i++;
}
?>
Where I have <?php the_permalink(); ?> I need it to somehow have its own url if that makes sense. So say localhost/post.php?id=1
- Anyone can leave a status
- Have the facebook like button on each status
However I cant seem to achieve this. I can get the like button under each status but as soon as one is clicked they are all clicked.
I hope someone can help.
Here is what I have:
<?php
mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$status="SELECT * FROM comments WHERE 'id'";
if ($_GET['$status'] == "$id")
$query="SELECT * FROM comments";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b>Database Output</b><br><br>";
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$comment=mysql_result($result,$i,"post");
echo "<b>($id)</b> $comment<br>";
echo "<div class='fb_like'>
<fb:like width='340' layout='standard' show_faces='false' href='<?php the_permalink(); ?>' colorscheme='default'></fb:like>
</div> <br><hr>";
$i++;
}
?>
Where I have <?php the_permalink(); ?> I need it to somehow have its own url if that makes sense. So say localhost/post.php?id=1