2012-07-25

this is my problem:

I have a table in my mysql database which contains some products, and it has two columns called "date_from" and "date_to" which determine the period when the product is active.

On my website a have a form where the admin can choose two datetime values and if the product's active period intersects the span that the admin chose, the page updates a product list.

This is my query, which I am using to achieve what I want:

I get this error though:

mysql said: MySql error number: 1064 MySql error decription: You have
an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near '.26. 12:11:43
AND date_to<2012.07.30. 12:11:46) OR (date_from>2012.07.26. 12:11:' at
line 1

Any ideas?

Show more