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?

Auto numbering
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Auto numbering
*
#30324
Auto numbering 11 Years, 11 Months ago Karma: 0
Can I insert autonumbering first column, when I get data from Joomla database?
The administrator has disabled public write access.
 
#30329
Re:Auto numbering 11 Years, 11 Months ago Karma: 748
Hello,

If you show data from MySQL database, you can use RANK() function. The sample can be found here.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#30330
Re:Auto numbering 11 Years, 11 Months ago Karma: 0
Hi I use this SQL string
Code:


SELECT  id,  title 
FROM  #__content
WHERE  catid =16 AND state=1
ORDER BY id DESC



how to use this string with RANK()
The administrator has disabled public write access.
 
#30332
Re:Auto numbering 11 Years, 11 Months ago Karma: 748
Try something like this:

Code:


SELECT  
  (@curRank := @curRank + 1) AS Rank,
  id,  title 
FROM  #__content, (SELECT @curRank := 0) r
WHERE  catid =16 AND state=1
ORDER BY id DESC



Regards,
ARI Soft
The administrator has disabled public write access.
 
#30333
Re:Auto numbering 11 Years, 11 Months ago Karma: 0
Thanks, You are great it's work for me
The administrator has disabled public write access.
 
Go to topPage: 1