Jump to content

Loop not looping


graham23s

Recommended Posts

Hi Guys,

 

i can't for the life of me see what's wrong with this loop! everything echo's out ok but when i go inside the loop it falls apart lol

 

code:

 

<?php
         // GET THE CUSTOMERS ORDER
         $qC = "SELECT * FROM `fcp_orders` WHERE `customer_id`='$cusSessionID'";
         $rC = mysql_query($qC) or die (mysql_error()); 
?>
<table align="" class="fcp-heading-main" border="0" width="600" cellpadding="0" cdellspacing="0" />
  <tr>
<td class="fcp-heading" colspan="2">You have selected to ship to your primary address.</td>
  </tr>
        <tr>
          <td class="fcp-heading-body" align="left"><b><?php print "$cusFN " . "$cusLN"; ?></b><br /><?php print "$cusAD"; ?><br /><?php print "$cusCT, $cusSC, $cusPZ"; ?><br /><?php print "$cusCO"; ?><br />Phone: <?php print "$cusTP"; ?></td>
         </tr>
        <tr>
	  <td class="fcp-heading" colspan="2">Your order details.</td>
	  </tr>
	<tr>
          <td class="fcp-heading-body" align="left">
          <?php
          while ($aC = mysql_fetch_arrray($rC))
          {   
               // VARS
               $orderID = $aC['product_id']; 
               
               $qP = "SELECT * FROM `fcp_products` WHERE `id`='$orderID'";
               $rP = mysql_query($qP) or die (mysql_error());           
               print $qP;
               // GET THE PRODUCTS FROM THE PRODUCTS TABLE

               // VARS
               $prodNM = $aP['product_name'];   
           
               // PRINT THEM OUT
               print "$prodNM<br />";
          }
          ?>
          </td>
         </tr>
	</table>	
?>

 

I can print out $orderID but that's the last thing that prints out and instead of bringing me 4 numbers back it only brinbgs back 1 as if the loop isn't working , i can't see anything wrong!

 

thanks for any help guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/140845-loop-not-looping/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.