我收到此错误信息:
"Parse error: syntax error, unexpected $end in C:\Users\Stacky\Desktop\xampp\htdocs\wweff\stackhelp.php on line 822"
我一直试图让这个代码通过摆弄工作只有一行我的代码,第54行。
以下是完整的代码。注意“// ^^^^右上方是第54行”。在下面的代码:
<html>
<head>
</head>
<body>
<?php
$objConnect = mysql_connect("localhost","root","") or die(mysql_error());
$objDB = mysql_select_db("thegoodhumor");
$strSQL = "SELECT * FROM gallery";
if (!isset($_GET['Page'])) $_GET['Page']='0';
$objQuery = mysql_query($strSQL);
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 16; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$strSQL .=" order by GalleryID ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
$cell = 0;
echo '<table border="1" cellpadding="2" cellspacing="1"><tr>';
while($objResult = mysql_fetch_array($objQuery))
{
if($cell % 4 == 0) {
echo '</tr><tr>';
}
if($cell == 2 || $cell == 3) {
echo '<td>RESERVED</td>';
} else {
echo '<td><img src="https://s3.amazonaws.com/imagetitle/' .
$objResult["Picture"];?>" height="190" width="190" /> . .$objResult["GalleryName"].'\</td>';
//^^^^ RIGHT ABOVE IS LINE 54.
}
$cell++;
}
echo '</tr></table>';
?>
<?php
//DELETED PAGINATION CODE for the sake of simplicity in StackOverflow
?>
</body>
</html>
<?php
mysql_close($objConnect);
?>
代码@thomas的完美解决方案。 +1到Mikel – 2011-03-21 05:43:56
该死的,非常好!谢谢! – 2011-03-21 05:52:55