Basically I do not want the data to show from within the SQL database if the date has expired. What I MAY have to do is change my date format but want to see if someone had suggestions on what I could be doing wrong or leaving out.
So right now I have the user recording their timeout of the data. The format is saved like this: YYYY-MM-DD
Then my code to display the records are as follows:
$current = date("Y-m-d");
$b = "SELECT * FROM mytable WHERE timeout > '%$current%' ORDER BY date ASC";
I've tried both combinations of > or <. < displays nothing at all. I have two records for testing. One set for the 31st and one for the 23rd. So obviously that date format is not being read correctly by the > or <.
Question
Volatile
Basically I do not want the data to show from within the SQL database if the date has expired. What I MAY have to do is change my date format but want to see if someone had suggestions on what I could be doing wrong or leaving out.
So right now I have the user recording their timeout of the data. The format is saved like this: YYYY-MM-DD
Then my code to display the records are as follows:
$current = date("Y-m-d");
$b = "SELECT * FROM mytable WHERE timeout > '%$current%' ORDER BY date ASC";
I've tried both combinations of > or <. < displays nothing at all. I have two records for testing. One set for the 31st and one for the 23rd. So obviously that date format is not being read correctly by the > or <.
Suggestions?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts