Page 1 of 1

Repeat region making my dynamic text not render!

Posted: Tue Jun 08, 2004 7:18 pm
by Idledaylight
Hi, through trial and error, I discovered that the following code

Code: Select all

<?php do { ?>
	<table width="259" height="36" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="90" rowspan="2"><img src="images/products/comingsoon.gif" width="90" height="90"></td>
          <td height="24" align="left" class="headerwhite"><img src="../Images/blank.gif" width="10" height="10"><?php echo $row_rsGetInfo['prodName']; ?></td>
        </tr>
        <tr>
          <td height="12" align="left"><p><strong><img src="../Images/blank.gif" width="10" height="50" align="left">Our Price</strong>:<?php echo DoFormatCurrency($row_rsGetInfo['prodPrice'], 2, '.', ',', '$'); ?> <br>
          <strong>Rental Period</strong>: 1 Day </p></td>
        </tr>
        </table>
		<br>
	<?php } while ($row_rsGetInfo = mysql_fetch_assoc($rsGetInfo)); ?>
is preventing this statement from rendering:

Code: Select all

<?php echo $row_rsGetInfo['subCatName']; ?>
If I place the second block before the repeat region, it displays fine, or even within it will work...but anywhere after, the php simply won't output it.

Thanks in advance for your time and help!

Josh

Re: Repeat region making my dynamic text not render!

Posted: Tue Jun 08, 2004 8:07 pm
by feyd
try

Code: Select all

<?php while ($row_rsGetInfo = mysql_fetch_assoc($rsGetInfo)) { ?>
	<table width="259" height="36" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="90" rowspan="2"><img src="images/products/comingsoon.gif" width="90" height="90"></td>
          <td height="24" align="left" class="headerwhite"><img src="../Images/blank.gif" width="10" height="10"><?php echo $row_rsGetInfo['prodName']; ?></td>
        </tr>
        <tr>
          <td height="12" align="left"><p><strong><img src="../Images/blank.gif" width="10" height="50" align="left">Our Price</strong>:<?php echo DoFormatCurrency($row_rsGetInfo['prodPrice'], 2, '.', ',', '$'); ?> <br>
          <strong>Rental Period</strong>: 1 Day </p></td>
        </tr>
        </table>
		<br>
	<?php } ?>

Posted: Tue Jun 08, 2004 8:57 pm
by markl999
The first tr also has 2 td's, so the 2nd tr should probably use a <td colspan="2" as it only has one td :o

Posted: Wed Jun 09, 2004 12:02 pm
by Idledaylight
Thanks for the responses!

The HTML is correct. Its a rowspan not a colspan.

I tried switching the do while loop for a while loop and the problem is still there. The php simply wont output that particular string. I've played around more and

Code: Select all

<?php echo 'test' ?>
will output just fine but not

Code: Select all

<?php echo $row_rsGetInfo['subCatName']; ?>
Any help would be appreciated!

Posted: Wed Jun 09, 2004 12:19 pm
by Idledaylight
Lol, I THINK I fixed it. Let me know if this makes sense. It works. But if its not correct than its not good enough.

the following loop:

Code: Select all

<?php do { ?>
	<table width="259" height="36" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="90" rowspan="2"><img src="images/products/comingsoon.gif" width="90" height="90"></td>
          <td height="24" align="left" class="headerwhite"><img src="../Images/blank.gif" width="10" height="10"><?php echo $row_rsGetInfo['prodName']; ?></td>
        </tr>
        <tr>
          <td height="12" align="left"><p><strong><img src="../Images/blank.gif" width="10" height="50" align="left">Our Price</strong>:<?php echo DoFormatCurrency($row_rsGetInfo['prodPrice'], 2, '.', ',', '$'); ?> <br>
          <strong>Rental Period</strong>: 1 Day </p></td>
        </tr>
      </table>
		<br>
	<?php } while ($row_rsGetInfo = mysql_fetch_assoc($rsGetInfo)); ?>
uses the variable $row_rsGetInfo to determine when to end the loop according to how many records there are. Is this just a counter? It seems like it is to me, so I replaced it with $recordCounter and it worked just fine and doesn't screw with the other dynamic text I was trying to output.

Let me know if this just somehow happens to be working now or if it looks good. I'm very new to dynamic web sites.

Thanks,

Josh

Posted: Wed Jun 09, 2004 12:55 pm
by feyd
seems a bit odd.. what's the code leading up to this?