I'm brand new to PHP and don't have the first clue about what I'm doing. I found the way to embed HTML in PHP by looking around this site.
However, I can't make this work. My code is:
<?php do { ?>
<?php if ($row_rsMore['contentID'] = 35) : ?>
<li><a href="aboutus.php"><h4><?php echo $row_rsMore['contentTitle']; ?></h4></a></li>
<?php elseif ($row_rsMore['contentID'] = 37) : ?>
<li><a href="contactus.php"><h4><?php echo $row_rsMore['contentTitle']; ?></h4></a></li>
<?php elseif ($row_rsMore['contentID'] = 38) : ?>
<li><a href="otherlinks.php"><h4><?php echo $row_rsMore['contentTitle']; ?></h4></a></li>
<?php else : ?>
<li><a href="more.php?idVal=<?php echo $row_rsMore['contentID']; ?>"><h4><?php echo $row_rsMore['contentTitle']; ?></h4></a></li>
<?php endif ?>
<?php } while ($row_rsMore = mysql_fetch_assoc($rsMore)); ?>
I've tried surrounding the number (35, 37 and 38) with single quotes, double quotes, brackets and variations on these themes.
What happens is that the 'contentTitle' for each of the statements displays correctly but each href shows the same link (that of the first 'if' ie: 'aboutus.php').
What have I got wrong?
==