dapperdanman1400
Programmer
I have a query in a php page that goes something like this:
SELECT * FROM posts WHERE post_time < '$php_var_date' LIMIT 0,1
I'm using this in a blog where I need the previous post's post date. php_var_date is an ISO 8601 formatted date. The post_time is of the data type datetime. While I don't get an error on execution of the query, it keeps returning the date EQUAL to php_var_date instead of the one previous to it. My question is, is this a MySQL glitch or is it something incorrectly set on the server?
SELECT * FROM posts WHERE post_time < '$php_var_date' LIMIT 0,1
I'm using this in a blog where I need the previous post's post date. php_var_date is an ISO 8601 formatted date. The post_time is of the data type datetime. While I don't get an error on execution of the query, it keeps returning the date EQUAL to php_var_date instead of the one previous to it. My question is, is this a MySQL glitch or is it something incorrectly set on the server?