in reply to Valid code?

$no_days = "(TO_DAYS(dateadded)-TO_DAYS(Now())>=-$newdateadded)";
Without running any code, it appears to me that you have a "units" problem. dateadded and Now are transformed by the TO_DAYS function but their difference is being compared to $newdateadded. Why doesn't TO_DAYS() apply to all 3 terms? Aside from that, this is string, why not:
$no_days = TO_DAYS($dateadded)-TO_DAYS(Now()) >= TO_DAYS($newdateadded);

Put your code in a program and run it!