Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:17:20+00:00 2026-06-16T00:17:20+00:00

Does anyone know a more efficient way to write the following. my load time

  • 0

Does anyone know a more efficient way to write the following. my load time over a minute right now. This what I came up with after an even longer codeset.

$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++;
  }

Please let me know if ths code is self explanatory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:17:21+00:00Added an answer on June 16, 2026 at 12:17 am
    $sql_statementj = "Select * from vinyl_figures WHERE ImageID = '$title'";
    $sql_statementj = "Select Series from vinyl_figures WHERE ImageID = '$title'";
    

    in these 2 statements you seem to make a mysql request for the same file if I got your code right. make these requests outside the loops, this should do some work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know a better (shorter/more elegant) way than simply writing a loop and
Does anyone know what is more efficient with regards to speed for finding a
Does anyone know any more details about google's web-crawler (aka GoogleBot)? I was curious
Does anyone know how to calculate the area in common between 2 or more
Does anyone know in which programming language the Googlebot was written? Or, more generally,
Does anyone know if there is a way to generate different code in the
Does anyone know of a way to contain a nonbreaking space in an html
Does anyone know if there is a way I can insert values into a
Does anyone know if it is possible to write a query that can produce
I'm not sure if this is possible, but does anyone know if I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.