| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
PHP/MySQL date question | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
PHP/MySQL date question
I am trying to add a page to my site that will show all titles with a release date greater than a certain date. This date is stored in the table as a string in just a regular date format (ie "01/02/2003"). Is there anyway to do what I want to do with the date in this format or am I going to have to convert all my dates to a timestamp?
thanks Ryan |
|||||||
#2
|
|||||||
|
|||||||
Hi Ryan,
Not quite on the subject but this was put together last week .. http://forum.x-cart.com/viewtopic.php?t=1418&highlight= Is the release date an extra field? If it is and you are wanting to compare it you can dissect parts of the string using PHP on the basis $day = substr($your_field,0,2) where the 0 is the start point (the first position is always 0 not 1) in the string and the 2 is the length. Therefore: $month=substr($your_field,3,2) and $year=substr($your_field,5,4)
__________________
ex x-cart guru |
|||||||
#3
|
|||||||
|
|||||||
Can that be done in the SQL statement though? I don't want to bring back all records and then only display the ones which meet the criteria. That would be way to slow (we currently have around 10000 items on the site). I thinking I might have to convert all my dates to a timestamp, but that sounds annoying.
thanks |
|||||||
|
|||
X-Cart forums © 2001-2020
|