有谁知道编写以下内容的更有效方法。我现在的加载时间超过一分钟。这是我在更长的代码集之后想出的。
$max = $i + 25;
while ($i < $max)
{
$memberno = $memberid;
if($pulledid!=$memberid)
{
$pulledid = mysql_result($result99,$i,"id_member");
$sql_statement = "Select vinyl_fortrade.ImageID,vinyl_fortrade.MemberID from vinyl_fortrade where exists (Select ImageID from vinyl_wanted WHERE MemberID = $memberno AND vinyl_wanted.ImageID = vinyl_fortrade.ImageID) AND vinyl_fortrade.MemberID=$pulledid";
$result=mysql_query($sql_statement)or die(mysql_error());
$num=mysql_numrows($result);
if($num>0)
{
$sql_statement2 = "Select vinyl_wanted.ImageID, vinyl_wanted.MemberID from vinyl_wanted where exists (Select ImageID from vinyl_fortrade WHERE MemberID = $memberno AND vinyl_wanted.ImageID = vinyl_fortrade.ImageID) AND vinyl_wanted.MemberID=$pulledid";
$result2=mysql_query($sql_statement2)or die(mysql_error());
$num2=mysql_numrows($result2);
$membername = mysql_result($result99,$i,"smf_members.member_name");
$userid2 = mysql_result($result99,$i,"smf_members.id_member");
if ($num2 > 0)
{
$lastlogged = mysql_result($result99,$i,"smf_members.last_login");
echo '<td><a href="http://vinylmationconnection.com/forum/index.php?action=pm;sa=send; u='.$userid.'"style="color: #FFF">'.$membername.'</a><br>Last Logged In:<br>';
echo date('Y-m-d', $lastlogged);
echo ':</td>';
echo '<td>';
$n = 0;
$m = 0;
while ($n < $num)
{
$title=mysql_result($result,$n,"vinyl_fortrade.ImageID");
$sql_statementj = "Select * from vinyl_figures WHERE ImageID = '$title'";
$resultj=mysql_query($sql_statementj)or die(mysql_error());
$seriess=mysql_result($resultj,0,"vinyl_figures.Series");
echo '<img src="http://vinylmationconnection.com/images/p'.$seriess.'/'.$title.'.jpg">';
$n++;
if($n%4=="0")
echo "<br>";
}
echo '</td><td>';
while ($m < $num2)
{
$title=mysql_result($result2,$m,"vinyl_wanted.ImageID");
$sql_statementj = "Select Series from vinyl_figures WHERE ImageID = '$title'";
$resultj=mysql_query($sql_statementj)or die(mysql_error());
$seriess=mysql_result($resultj,0,"vinyl_figures.Series");
echo '<img src="http://vinylmationconnection.com/images/p'.$seriess.'/'.$title.'.jpg">';
$m++;
if($m%4=="0")
echo "<br>";
}
echo '</td> </tr>';
}
}
}
$i++;
}
请让我知道这些代码是否可以自我解释。