RichardODreamweaver wrote:
> Can this code block also be used for dynamic table rows
instead of just layout
> cells?
Yes, although your code isn't very efficient. This is much
simpler:
<?php do { ?>
<?php
$bgcolor = '';
if ($row_recordset['NOTETYPE'] == "Action") {
$bgcolor = ' bgcolor="#CCCCCC"';
}
elseif ($row_recordset['NOTETYPE'] == "Note") {
$bgcolor = ' bgcolor="#00FFCC"';
}
?>
<tr<?php echo $bgcolor; ?>>
<td><?php echo $row_recordset['TYPE'];
?></td>
<td><?php echo $row_recordset['OTHER'];
?></td>
</tr>
<?php } while ($row_recordset =
mysql_fetch_assoc($recordsetName)); ?>
> does not seem to work and seems to jump to the else
statement.
PHP is case-sensitive. The values must be "Action" or "Note",
not
"action" or "note".
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/