I’m quite new to PHP and MySQL. I’m stuck with a problem, i will try to explain my problem.
TODAY = 2013-01-13 18:37:00
PRODUCT = P000001
TABEL : ASSEMBLY
-----------------------------------------------------------------
∣ PRODUCT ∣ COMPONENT ∣ BEINFORCE ∣ WILLEXPIRE ∣
-----------------------------------------------------------------
∣ P000001 ∣ C000001 ∣ 2013-01-01 18:37:00 ∣ 0000-00-00 00:00:00 ∣
-----------------------------------------------------------------
∣ P000001 ∣ C000002 ∣ 2013-02-01 18:37:00 ∣ 0000-00-00 00:00:00 ∣
-----------------------------------------------------------------
∣ P000001 ∣ C000003 ∣ 2013-01-01 18:37:00 ∣ 2013-01-10 18:37:00 ∣
-----------------------------------------------------------------
Output must be:
-----------------------------------------------------------------
∣ PRODUCT ∣ COMPONENT ∣ BEINFORCE ∣ WILLEXPIRE ∣
-----------------------------------------------------------------
∣ P000001 ∣ C000001 ∣ 2013-01-01 18:37:00 ∣ 0000-00-00 00:00:00 ∣
-----------------------------------------------------------------
Query from table ASSEMBLY must check PRODUCT, BEINFORCE and WILLEXPIRE and output table.
If I understand you correctly, including the comment below your question, then you want those rows of
ASSEMBLYwhichBEINFORCEless than or equal toTODAYWILLEXPIREwhich is zero, which I take to denote a date in the futurePRODUCTyou requestedYou can achieve this using the following query, assuming user variables to represent your parameters. You could of course use prepared query placeholders as well.