Hello Vaidas,

Monday, May 9, 2005, 3:08:26 PM, you wrote:

hm founded something intresting :)

set @mynr:=0;
Select @mynr as nr,table.id from table
where @a:=IF((table.id=0),0,(@a+1)) having table.id=518 order by id

strange IF hack :)
main problem what this metod not fast. tested in table with 35024
rows, result i got only after 0.7s!

what i can improve?

VZ> Hello Roger,

VZ> Monday, May 9, 2005, 2:56:18 PM, you wrote:


VZ> Heh if i know page i would haven't problem.
VZ> but i need  to get also correct page with link
VZ> doomain.con/items.php?showid=45

VZ> it can be anywhere! :)


VZ> I making web application with data binding (IE stuff) data is loading
VZ> very fast, can be 1000 and 1000000 of rows, it's not problem, and user
VZ> interface with data loads very fast.

VZ> if i use scroll, JS count's what possition is on row, and if needed
VZ> loading data from server.

VZ> But now i need to to simple trick, SelectRowWhereId(1525)
VZ> script must now position of that row in database with same WHERE and
VZ> ORDER.

VZ> so i never know "page" number.

VZ> :)

RB>> Vaidas Zilionis wrote:
RB>> [...]
>>> Example items are displayed 100 in page, and i display 20 pages
>>> numbers
>>> 1 ... 4[5] 6 ....x
>>> doomain.con/items.php?page=5
>>> 
>>> and i get all result here with limit 400,100

RB>> Yes, with PHP it would be something like this:

RB>> $items_per_page = 100;
RB>> $limit_clause =
RB>> ((int)$page-1)*$items_per_page.','.$items_per_page;

>>> If i use it
>>> 
>>> doomain.con/items.php?showid=45 (example he is in 7 page)
>>> 
>>> i want to see same table with page numbers and ect. And record must be
>>> in 7 page. 1 ... 6 [7] 8 ....x

RB>> Why not just create your links like this:

RB>> doomain.con/items.php?showid=45&page=7

RB>> At this stage, when you create the link, you allready know what page you
RB>> are on. Why waste time and try to calculate it again?





VZ> -- 
VZ> -- 
VZ> Vaidas Žilionis
VZ> Mobile: +370 616 91393
VZ> ICQ: 35174940
VZ> Website: www.zilionis.net
VZ> Project: www.sitesupra-tools.net






-- 
-- 
Vaidas Žilionis
Mobile: +370 616 91393
ICQ: 35174940
Website: www.zilionis.net
Project: www.sitesupra-tools.net



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to