Re-order display of data-base
I have a table on my site of names and comments that is pulled from a sql data-base. Works perfect you can add comments aswell.
How would i go about displaying it as the last comment that was posted to be on top rather than at the bottom?
my current code for displaying the table is:
does your table only has the fields name and comment? you would need an extra field that would hold the date and time when the comment was created then you can order them. For example lets say the field is named created, the sql query would be something like this
I hope this helps.
ye it does actually have a date and time but i did try that with date and time but think i got it wrong. Either way i just did the same as what you did only witht he ID from the db which in my eyes is ideal anyway unless thats something that should not be done never the less it seems to work :D thanks for that :D
ok now i have another problem...
it does order correctly to a certain degree
i have changed the order to a different field now which is an alt date which is put in to a field and subbmited via a form
trouble is the dates get mixed up.
if i have 1,5,2012 in one record
13,5,2012 in the second record
and 1,6,2012 in the third record
1,6,2012 will display as the second record on the table i have which is not what i need becase 1,6,2012 is after 13,5,2012
if you refer to my screenshot for a better description
you can see friday `1, june 2012 is the 2nd row down which should be the last row. It is not ordering from this date it is ordering from a hidden date which is the same just in a different format. dateFormat: 'd-m-y',
how would i go about getting this in the right order?
Nike Free 3.0 V2 : Nike Free Run Shoes
Don't worry Additionally there is a as Nike encompasses a line of green shoes for you guessed it-your camera. cheap air jordan shoes In fact however , there is more options easily to get lime green Nike shoes for ladies though all tailored specifically to suit running. Choose shoes involving Nike Air Max Line and also LunarGlide and and the wonderful Kukini Fee wrinkles. You can find full green shoes or see black shoes with green cheap air jordans swoosh and trimmings. Run and train in comfort and style with Nike shoes for women.
I think it has a date and time, but I try with the date and time, but I think I made a mistake. In any case, I did the same thing that you're really just Compliance based identification data, which is ideal for me anyway if it is something that you should not look run: D
|All times are GMT. The time now is 04:24 PM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0