-1

Hello I want to select all the entrees in a MYSQL database if a certain value in a row - another value is greater than a certain number. I want something like this but that actually works, is it possible?

$str = date("d/m/y");
$donetime = strtotime($str);

$currentname = mysql_query("SELECT * FROM `entree` WHERE IF(`Uploaded`-$donetime <= 604800)  ");

Is it possible to have something like this? Thanks for your help.

1 Answers1

0

If you want to SELECT all rows WHERE Uploaded-$donetime <= 604800 then you should write the following.

SELECT * 
FROM `entree` 
WHERE `Uploaded`-$donetime <= 604800

You might want to read up on SQL.

Martin
  • 448
  • 4
  • 12