有谁知道什么可能导致这个致命的错误?

时间:2011-05-08 03:55:39

标签: php mysql mamp

我在MAMP上的PHP错误不起作用,我已将它们打开但仍然没有 那里有一个错误,我看了看,但却找不到任何东西 它没有返回,所以我猜这是一个致命的错误。

<?php include("scripts/config.php");
include("scripts/facebook.php");

"INSERT INTO likes (like, pop, date)
VALUES ('$_POST[like_box]','0', now())";       
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>theupdate</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
//More Button
$('.more').live("click",function() 
{
  var ID = $(this).attr("id");
  if(ID)
  {
    $("#more"+ID).html('<img src="moreajax.gif" />');

    $.ajax({
      type: "POST",
      url: "new/ajax_more.php",
      data: "lastmsg="+ ID, 
      cache: false,
      success: function(html){
      $("ol#updates").append(html);
      $("#more"+ID).remove();
    }
  });
}else{
  $(".morebox").html('no more posts to display'); 
}
return false;

});
});

</script>

<style>a { text-decoration:none; color:#0066CC}
a:hover { text-decoration:underline; color:#0066cc }
*
{
    margin: 0px;
    padding: 0px;
}
ol.timeline
    { list-style:none}ol.timeline li{ position:relative;border-bottom:1px #dedede dashed; padding:8px; }ol.timeline li:first-child{}
    .sssss {
    color: #ededed;
    height:1px;
}

    .morebox
    {
    font-weight:bold;
    color:#333333;
    text-align:center;
    border:solid 1px #333333;
    padding:8px;
    margin-top:8px;
    margin-bottom:8px;
    }
    .morebox a{ color:#333333; text-decoration:none}
    .morebox a:hover{ color:#333333; text-decoration:none}
    #container{margin-left:60px; width:580px }

.style11113 {
    font-family: Arial, Helvetica, sans-serif;
}

.style11114 {
    text-align: left;
}
.style11115 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: medium;
}

.style11117 {
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
    font-size: medium;
}

.style11118 {
    text-align: right;
}
.style11119 {
    color: #ededed;
    text-decoration: none;
    font-family: "lucida grande", tahoma, verdana, arial, sans-serif;
    margin-top: 13px;
}
.style11120 {
    margin-top: 0px;
}

.style11121 {
    margin-bottom: 0px;
}

.style11122 {
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
    font-size: small;
    text-align: left;
    margin-top: 4px;
}

.style11123 {
    font-size: x-small;
}

</style>

</head>
<body>
<div align="center">
    <div align="left" style="height: 36px; width: 954px; background-color:#7B0004;" >
        <table style="width: 100%; height: 32px" class="style4">
            <tr>
                <td style="height: 30px; width: 144px;">&nbsp;&nbsp;&nbsp;<span class="style11113"><strong>facebook quotes</strong></span></td>
                <td style="height: 30px; width: 594px;"><a href="new.php" class="style4">new likes</a> &nbsp;<a href="popular.php" class="style4">popular 
                likes</a></td>
                <td style="height: 30px"><a href="http://www.facebook.com" class="style4">back 
                to facebook.com</a></td>
            </tr>
        </table>
    </div>
    <div style="border-left: 1px solid #b3b3b3; border-right: 1px solid #b3b3b3; border-top: 0px; border-bottom: 1px  solid #b3b3b3; width: 859px; height: 545px; ">
        <div style="height: 564px; width: 952px;">
            <div style="width: 297px; float:right; height: 538px;">
                <?php
$sql=mysql_query("select * from likes ORDER BY date DESC LIMIT 9");
while($row=mysql_fetch_array($sql))
{

$like_count = $facebook->api(array(  
    'method' => 'fql.query',  
    'query' => 'select like_count from link_stat where url = "http://www.quotefacebook.com/like.php?id=$row['id']"'
));

mysql_query("UPDATE likes WHERE id=$row['id'] SET pop=$like_count")

?>


<?php } ?>
</div>



            <div style="width: 654px; float:left; height: 540px;" class="style11114">
                <div class="style11114">
                    <span class="style11115">&nbsp;</span><span class="style11117">create a facebook like..</span><br /></div>
                <form method="post" action="self">
                    <div class="style11118">


                        <table class="style11120" style="width: 100%; height: 59px">
                            <tr>
                                <td style="width: 648px">
                                <textarea name="TextArea1" style="width: 524px; height: 52px"></textarea>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style11118" style="width: 648px">
                                <input name="Submit1" style="width: 78px" type="submit" value="submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                &nbsp;</td>
                            </tr>
                        </table>
                                                <hr class="sssss " noshade="noshade" style="height: 1px" />

                    </div>
                </form>

            <?php 
$sql=mysql_query("select * from likes ORDER BY date DESC LIMIT 9");
while($row=mysql_fetch_array($sql))
{
$like_count = $facebook->api(array(  
    'method' => 'fql.query',  
    'query' => 'select like_count from link_stat where url = "http://www.quotefacebook.com/like.php?id=$row['id']"'
));
*
mysql_query("UPDATE likes WHERE id=$row['id'] SET pop= " . $like_count . "")

?>


                <table style="width: 100%; height: 7px;" class="style11119">
                    <tr>
                        <td style="width: 68px; height: 23px;" class="style11111 " valign="top">
                        <div id="fb-root">
                        </div>
                        <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
                        <fb:like href="http://www.quotefacebook.com/like.php?id=<?php print $row['id']; ?>" send="false" layout="button_count" width="0" show_faces="false" font="">
                        </fb:like>
                        </td>
                        <td style="height: 23px" class="style11112"><?php print $row['like']; ?>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 23px;" class="style1" colspan="2" valign="top">
                        <hr class="sssss " noshade="noshade" style="height: 1px" />
                        </td>
                    </tr>
                </table>
<?php } ?>
                <div id="more<?php echo $msg_id; ?>" class="morebox">
                    <a href="#" class="more" id="<?php echo $msg_id; ?>" style="font-family:Arial, 'Helvetica', sans-serif;
">more</a> </div>
</div>



            <div class="style11121">

<div style="width: 939px; height: 16px;" class="style11122">
    <span class="style11123">this website is not associated with facebook in anyway, 
    at all.. seriously.&nbsp; </span>
    <span class="style11123" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
    <span class="Apple-style-span" style="line-height: 15px; ">© 2011</span></span></div>

            </div>



            </div>
    </div>
</div>

</div>

</body>

</html>

1 个答案:

答案 0 :(得分:3)

第二个while循环中的代码中有一个随机的星号字符。您在此行中的PHP语句中也缺少两个分号:

mysql_query("UPDATE likes WHERE id=$row['id'] SET pop=$like_count")

和这一行

mysql_query("UPDATE likes WHERE id=$row['id'] SET pop= " . $like_count . "")

如果这不能解决您的错误,那么在包含之后,您有:

"INSERT INTO likes (like, pop, date)
VALUES
('$_POST[like_box]','0', now())";

这是一个未分配给任何内容的字符串。它可能会导致您的错误。拿出来试试吧。如果这不是问题的根源,那么看看你的位置:

"UPDATE likes WHERE id=$row['id'] SET pop=$like_count"

我会在数组变量和字符串的其余部分之间添加一个点,这样它就会变成:

"UPDATE likes WHERE id=".$row['id']." SET pop=$like_count"

我会在您执行此操作的多个位置进行此更新。

此外,第一次循环后的额外PHP标签实际上是不必要的。你可以正常关闭while循环。所以而不是:

?>


<?php } ?>

你可以尝试:

} ?>