bubu Posted February 25, 2005 Report Share Posted February 25, 2005 uz saakuma pusi - pavisam elementaari, kad $start == pirmo lapu;uz beigu pusi - ar musql_num_rows nosaki kopējo rakstu skaitu (protams - pieprasiijumam jaabuut bez LIMIT). 14235[/snapback] Nepareizi, nevajag mysql_num_rows lietot! Tā tak liela bremze, ja ir tūkstošiem ierakstu. Vai nav vienkāršāk: list($count)=mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM tabula")); Link to comment Share on other sites More sharing options...
ohmygod Posted February 25, 2005 Report Share Posted February 25, 2005 (edited) Sheit bija cits teksts.... Bubu, tu domaa ka vinjam raksti buus tuukstoshiem? Paaris desmiti, varbuut simts maksimaali. Tos jaunu uzskaitiit var vienu reizi sesijas laikaa... Bet nu, tavs variant, protams, ka ir labs... Edited February 25, 2005 by ohmygod Link to comment Share on other sites More sharing options...
PheliX Posted February 25, 2005 Report Share Posted February 25, 2005 es parasti to risinu taadaa veidaa: $result = $mysqli->query("SELECT SQL_CALC_FOUND_ROWS * FROM table ORDER BY karta DESC LIMIT $start, 2"); $result2 = $mysqli->query("SELECT FOUND_ROWS()"); $skaits=$result2->fetch_row(); echo $skaits[0]; Link to comment Share on other sites More sharing options...
Recommended Posts