Jump to content

Missing Return


spooke2k

Recommended Posts

please help am so stuck im only display 19 restults and for life of me cant work out why

Its a nightmare im sure its something obvious but i cant work it out

 

Ps this isnt all cod ejust code that relates to the loops

 

Thanks

 

 

select * from pressimagelink where details like '%g069%' or productcode like '%g069%' order by productcode asc LIMIT 0,20

 

$rowsPerPage = 20;

 

  $count = 1;

 

  while($row = mysql_fetch_array($result))

 

  {

 

    $productname[$count] = $row['productcode'];

    $radioList = array($productname[$count] => $productname[$count]);

    $count ++;

 

  }

 

 

  $start = 1;

  $end = 5;

  //$totalplus = 1;

 

  while($start <> $end)

 

  {

 

  // Sets initals product Code Array & Sets Radio Array

 

  $count = 1;

 

  //While set of 5 check first

 

  $stoponfive = 1;

 

  //set Product

 

  while($stoponfive != 6)

 

              {

 

      $totalall = ($totalplus + $stoponfive);

                          echo "<td width=\"15%\"><div align=\"center\"> Product Code {$productname[$totalall]}</div></td>";

                          $stoponfive ++;

 

              }

 

 

 

  // Return line

 

  echo "<tr>";

 

  echo "</tr>";

 

 

 

  $stoponfive = 1;

 

  //set image

 

  while($stoponfive != 6)

 

              {

 

                $totalall = ($totalplus + $stoponfive);

 

              echo "<td width=\"15%\">

                          <div align=\"center\">

                          <img src=\"http://images/{$productname[$totalall]}.jpg\"

                          alt=\"no image available\"/></div></td>";

 

                          //echo $productname[$totalall];

 

                          $stoponfive++;

 

              }

 

 

 

  // Return line

 

  echo "<tr>";

  echo "</tr>";

 

  $stoponfive = 1;

  //set radio

 

  while($stoponfive != 6)

 

              {

 

              //checks against previous values in checked

 

              $selected = ($value==$_POST[group2])?' checked':'';

 

              $totalall = ($totalplus + $stoponfive);

 

              echo "<td width=\"15%\"><div align=\"center\"> <input type=\"radio\" name=\"group2\" value=\"$productname[$totalall]\"$selected></div></td>";

 

              $stoponfive ++;

 

              }

 

           

 

              echo "<tr bgcolor=\"#CCCCCC\">

 

        <td height=\"10\" colspan=\"5\"></td>

 

        </tr>";

 

                       

 

  echo "<tr>";

 

  echo "</tr>";

 

 

 

  $start ++;

 

 

 

              if($totalplus == 1)

 

                          {

                                      $totalplus = $totalplus + 5;

 

                          }else

 

                                      {

                                      $totalplus = $totalplus + 5;

                                      }

  }

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.