gpt4 book ai didi

PHP画廊问题

转载 作者:行者123 更新时间:2023-11-29 00:54:09 26 4
gpt4 key购买 nike

好的,我有一个由数据库填充的画廊,但出于某种原因,它没有提取 2011 年 5 月 31 日之后的条目。我已经搜索了代码,但找不到任何日期限制,所以我不知所措至于为什么它没有引入任何最近的条目。

我还查看了数据库表,没有发现 5 月 31 日之前的条目和当前条目之间有任何不规则之处。

<?php
//GALLERY PAGE
$user="USER";
$password = "PASSWORD";
$database = "GALLERY";
$hostname_portfolio ="localhost:3306";

//gets the page number from the URL

if($_GET["pageNum"]==''){
$listedNum=0;

//gets the page limit from the URL
$limit=5;
}

else{
$listedNum=$_GET["pageNum"];

//gets the page limit from the URL
$limit=$_GET["limit"];

}
//creates the list of projects and puts them into an array
$project= array();

$con = mysql_connect($hostname_portfolio,$user,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

$dbcon = mysql_select_db("GALLERY", $con);
if (!$dbcon)
{
die('Could not connect: ' . mysql_error());
}
if ($dbcon)
{
}

mysql_select_db($database, $con);

$result = mysql_query("SELECT * FROM Persons ORDER BY date_uploaded DESC");


echo"<div class='clear' style='clear:both;'></div>";

$j=0;
do{
if($row['approved']=="true"){
$project[$j] =
"<div class='project-list'>
<div class='user-project'>
<div class='container'>
<div class='before-box' >
<p class='picture_state'>Before</p>
<a href='http://THEURL.com/". $row['image_path']."'>
<img src= '". $row['image_path']. "' width='400px' height='300px'/></a>
<br />
</div>
<div class='after-box'>
<p class='picture_state'>After</p>
<a href='". $row['picture_state']."'>
<img src= '". $row['picture_state']. "' width='400px' height='300px' /></a>
<br />
</div>
<div class='sidebox'>
<div class='inner-sidebox'>
<p class='date-project'>
Submitted by " . $row['FirstName'] . " " . $row['LastName']. " on " .$row['date_uploaded']. "</p>
<p> " .$row['decription']. "</p>";
if($row['ATTR1'] || $row['ATTR2']){
$project[$j] .= "<p>Used ";
if ($row['ATTR1']){
$project[$j] .= "PRODUCT2&trade;";
if ($row['color1']){
$project[$j] .= " in " . $row['color1'];
}
if ($row['ATTR2']){
$project[$j] .= " and ";
}
}
if($row['ATTR2']){
$project[$j] .= "PRODUCT<sup>&reg;</sup>";
if ($row['color2']){
$project[$j] .= " in " . $row['color2'];
}
}
$project[$j] .= "</p>";
}
$project[$j] .= "
</div>
</div>
</div>
<div class='clear' style='clear:both;'>
</div>
</div>
<div class='clear' style='clear:both;'>
</div>
</div>
<div class='clear' style='clear:both;'>
</div>";
$j++;
}

}

while($row = mysql_fetch_array($result));

$max=sizeof($project);

for($i=$listedNum;$i<$limit;$i++){

echo $project[$i];

}


$max=sizeof($project) - 1;

echo "<div class='bottom' style='width:170px;margin:0px auto;'>";

if($listedNum > 0){
$prevPageNum=$listedNum - 5;
$lastPage= $limit - 5;
echo "<a href='http://THEURL.com/gallery.php? pageNum=".$prevPageNum."&limit=".$lastPage."'>< Last Page </a>";
}
else{
$prevPageNum=$listedNum;
$lastPage= $limit;
}
echo"&nbsp;&nbsp;";
if($limit <= $max){

$newPageNum=$listedNum + 5;
$nextPage= $limit + 5;
echo "<a href='http://THEURL.com/gallery.php?pageNum=".$newPageNum."&limit=".$nextPage."'> Next Page ></a>";

}

else{
$newPageNum=$listedNum;
$nextPage= $limit;
}

echo "</div>";

mysql_close($con);
?>

最佳答案

我猜它是以下之一:

  1. 您的服务器只允许您在每个查询中提取“x”行(并且“x”不是在 5 月 31 日)

  2. 或者 5 月 31 日之后的文件有些不同。与之前相比

关于PHP画廊问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6918506/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com