Show if item uploaded within the last 2 weeks
I've done this before in good old mySQL but can't get it to work when using mySQLi. I have a "NEW" tag I want to show when an item is less than 2 weeks old. I have a DatePosted timestamp field in the database. I've tried the following code but it's displaying the tag for every record:
<?php if((date("Y-m-d", strtotime($rsMortgages->getColumnVal(['DatePosted'])) >= date("Y-m-d", strtotime("+14 days"))))) { // Show if column... ?>
<span class="label label-primary">NEW</span>
<?php } // Show if ?>
Can you help me to amend this so that it works?