But if there are rows in the record set it goes into a for loop that will use variable $i to increment through the recordset. My problem seems to be coming from the for loop, I think. I went through and commented out everything after the else and it printed out "No Orders In Progress" perfectly. But after I uncommented out the php code within the span tags, but left the for loop declaration commented out, it worked fine. I'm not sure what it can be. Could someone look over it and let me know if they see something please. Here's the code:
Code: Select all
<div id="generic">
<div id="left_column">
<div class="grey_block"> <span class="subtitle">Orders</span>
<?php if(!mysql_num_rows($orders)) { ?>
<span class="block">No Orders In Progress</span>
<?php } else {
for($i=0;$i<=mysql_num_rows;i++) {?> // <----- if you comment out this line and line marked below it works.
<div class="block"> <span class="inline">Order Number: </span> <span class="inline"><?php echo mysql_result($orders,$i,0); ?></span>
</div>
<div class="block"> <span class="inline">Date Ordered: </span> <span class="inline"><?php echo mysql_result($orders,$i,3); ?></span>
</div>
<div class="block"> <span class="inline">Currently: </span> <span class="inline"><?php echo mysql_result($orders,$i,5); ?></span>
</div>
<?php if(mysql_result($orders,$i,5) == "complete") { ?>
<div class="block"> <span class="inline">Date Complete: </span> <span class="inline"><?php echo mysql_result($orders,$i,4); ?></span>
</div>
<?php }
} // <---- not sure if I need any ";" here or not. But if you comment out this curly brace, and above, it works.
} ?>
</div>
</div>
</div>