Order By Time Not Working |
Hi, I am working on my project but for some reason my order_by('time', 'asc') is not sorting out my list correct
As you can see number 4 and 8 should be closer together but is not I am not sure if its because the way I have my database column set up if it is please let me know what it should be. How can I make sure is displayed by correct time or career? PHP Code: public function list() { Here is a copy of my database
Look at this maybe it will help you.
MySQL EXTRACT() Function You can use this with order by also... What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(02-13-2018, 04:26 AM)InsiteFX Wrote: Look at this maybe it will help you. Thanks I changed couple things in data base I had it like int() in column changed column to text now time in correct order
You should use DATETIME DATE and TIME fields for storing date and time.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Career should be either a varchar(length) or text.
For the Time you can use this: MySQL TIME_FORMAT() Function What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Would be problem in field selection, Might be You have choosed VARCHAR Field insted of DATETIME.
If you read the posts you would have read that he changed it to a TIME field.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |