Im having a problem with my display not showing corectly. I query a MySQL DB, return a recordset (lets say 10 records), then do a for loop to cycle thru 10 times and create in essence 10 new table rows to display all my info. I know the "<#DOMINI_TEXT$d#>" is working correctly because if I change $d to 6, the 7th record from the recordset is displayed. But that is the only one to be displayed. Where am I going wrong in my template code?
Gathering the information
for my template code:
And finally where I place the live info in the template:
Gathering the information
Code:
$arrDOMINI_INFORMATION = mySQL_query("SELECT * FROM $tblDOMINI WHERE MAGE_ID = '$varMAGE_NUMBER'"); // or die(mysql_error());
$varDOMINI_COUNT=mysql_numrows($arrDOMINI_INFORMATION);
mysql_close();
$d=0;
for my template code:
Code:
<?
$template = <<< HTML
...blah blah blah...
...other stuff other stuff...
<table cellpadding = "0" cellspacing = "0" border = "0">
<tr>
<td>
<img src="images/domini_top.jpg" border = "0" width = "432" height = "174">
</td>
</tr>
<tr valign="top">
<td class="renuntio" height="254">
<? for($d = 0; $d < $varDOMINI_COUNT; ++$d) { ?>
<table width = "432">
<tr>
<td class = "newsBold">
<center>
<#DOMINI_TEXT$d#>
</center>
</td>
</tr>
</table>
<? } ?>
</td>
</tr>
<tr>
<td>
<img src="images/domini_bottom.jpg" border="0" height = "130">
</td>
</tr>
</table>
...blah blah blah...
...other stuff other stuff...
HTML;
?>
And finally where I place the live info in the template:
Code:
while($d<$varDOMINI_COUNT){
$varDOMINI_TEXT = mysql_result($arrDOMINI_INFORMATION,$d,"DOMINI_TEXT");
$template = eregi_replace("<#DOMINI_TEXT$d#>", $varDOMINI_TEXT, $template);
$d++;
}