how do you order by date if dafe field is a text field?
Posted 19 July 2006 - 08:28 PM
(can this be changed?)
so I made the date field = varchar
I am the only "forms entry person" for our club
and we print out the dues monthly on a php web page
in reverse order (of date)
10 membername 1 jul 18
11 membername 2 jul 17
15 membername 3 jul 12
12 membername 4 jul 04
ergo = I enter the 'date' field in my html forms as jul 4, etc
but the 'order by' does not work as desired
when I did a sample ["order by" paid] (ie $)
it listed them as desired (ie my syntax is ok - just not for the varchar field for date)
Posted 19 July 2006 - 08:30 PM
I dont know how you would sort through them if it's varchar or other text type.
Posted 19 July 2006 - 10:27 PM
ok - will research the date_format stuff
but am I STUCK with the input of xxxx-xx-xx?
duh - these are all 2006 !
ws thinking if inputing the month and day in differnet fieilds
then sort on day !
Posted 19 July 2006 - 10:32 PM
Posted 19 July 2006 - 10:44 PM
Expecting your visitors to enter information in a pre-selected format is best (or only) accomplished by forcing them to adopt something they may find awkward. A simple solution is to use a 'date picker' script that allows them to choose a date they recognize but which generates a date in a controlled format that you can use for a database. http://www.rainfores...etimepicker.htm is one I've used in a number of commercial sites and seems to work well.
Just because the date is stored in your database as yyyy-mm-dd (the only sortable form), doesn't mean you have to display it to site visitors that way. The date() and mktime() functions allow you to re-present a yyyy-mm-dd date in whatever way you want.
Posted 20 July 2006 - 12:14 AM
or [php] * 1000... PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users