graham23s Posted January 14, 2009 Share Posted January 14, 2009 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 More sharing options...
Zhadus Posted January 14, 2009 Share Posted January 14, 2009 while ($aC = mysql_fetch_arrray($rC)) You have "mysql_fetch_arrray" with an extra "r". Link to comment https://forums.phpfreaks.com/topic/140845-loop-not-looping/#findComment-737194 Share on other sites More sharing options...
graham23s Posted January 14, 2009 Author Share Posted January 14, 2009 Man alive i have spent 2 hours on that lol thanks for that mate Graham Link to comment https://forums.phpfreaks.com/topic/140845-loop-not-looping/#findComment-737196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.