|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
MySQL: LIMIT
hi,
how do I show the last, say 20 rows? LIMIT 1,-1 shows me every row except the first. but how do I select the last 20? a solution would be: $limit = mysql_numrows($result); $limit2 = mysql_numrows($result) - 20; SELECT ... LIMIT $limit2,$limit1; BUT, before I get mysql_numrows I have to execute the query, but I want to execute it with my limits !!! thx for your help |
|
#2
|
|||
|
|||
|
RE: MySQL: LIMIT
how about ordering it the opposite way and then grabbing the first 20?
|
|
#3
|
|||
|
|||
|
RE: MySQL: LIMIT
uhm, a good solution, but then the records which are shown are also wrong ordered. but if nothing else works, I´ll do that.
thx |
|
#4
|
|||
|
|||
|
RE: MySQL: LIMIT
I don't think you can do the query you want in a single query in mySQL.
You could do a fast count... and then use the count for your second query. That should be fairly fast, and without bringing back a ton of rows you don't want... Cheers, Keith. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MySQL: LIMIT |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|