Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Sort By Created
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Sort By Created
#22750
Sort By Created 12 Years, 6 Months ago Karma: 0
Hi, I have a column in my database called cf_created it stores the data like this 2011-12-13 23:26:51 , how can I get the column default sort to sort using this data ?, I have tried putting in cf_created into the column index but the sorting seems erratic and not in date / time order. Another option would be to sort via the field cf_id which just goes 1, 2, 3, 4 etc but I cant work out how to get the sorting working correctly ?.
Thanks
Iain
The administrator has disabled public write access.
 
#22760
Re:Sort By Created 12 Years, 6 Months ago Karma: 748
Hello,

It is possible to sort by this field directly in a SQL query. It will look like:

Code:


SELECT
 *
FROM
 tbl
ORDER BY
 cf_created



Regards,
ARI Soft
The administrator has disabled public write access.
 
#22832
Re:Sort By Created 12 Years, 6 Months ago Karma: 0
thanks for that
The administrator has disabled public write access.
 
#22833
Re:Sort By Created 12 Years, 6 Months ago Karma: 0
Non related question, is there an easy way to cut off a line of text at a specific length in php ?, i have a databse field called emailmessage and i echo it on the page but i only want a summary of the first lets say ten words, either that or to a specific width of 200px but cant seem to find a way to do it, setting a fixed width and height just seems to wrap the text, but it keeps on expanding down regardless of what height i set.
The administrator has disabled public write access.
 
#22835
Re:Sort By Created 12 Years, 6 Months ago Karma: 748
See substr PHP function.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1