Навигация - Visavi.net https://visavi.net/ RSS - Visavi.net https://visavi.net/assets/img/images/logo_small.png RSS - Visavi.net https://visavi.net/ [email protected] (admin) [email protected] (admin) Mon, 23 Dec 2024 18:17:40 +0300 5. о спасибо <img src="https://visavi.net/uploads/stickers/smile.gif" alt="smile"> https://visavi.net/topics/1611/53041 Навигация Nu3oN Sun, 11 Oct 2009 14:21:56 +0400 Сообщения https://visavi.net/topics/1611/53041 <pre class="prettyprint">$usersd = mysql_query(&quot;SELECT * FROM `users` ORDER BY `id` ASC LIMIT $start, 10&quot;);</pre> https://visavi.net/topics/1611/52994 Навигация Иван Sun, 11 Oct 2009 13:03:13 +0400 Сообщения https://visavi.net/topics/1611/52994 Вот и я не знаю что такое <img src="https://visavi.net/uploads/stickers/D.gif" alt="D"> https://visavi.net/topics/1611/52917 Навигация Nu3oN Sun, 11 Oct 2009 10:48:17 +0400 Сообщения https://visavi.net/topics/1611/52917 <pre class="prettyprint"> &lt;?php $total = mysql_result(mysql_query(&quot;SELECT COUNT(*) FROM `users`&quot;),0); $start = isset($_GET&#91;&#039;start&#039;]) ? abs((int)$_GET&#91;&#039;start&#039;]) &#58; 0; if($start &gt; $total) $start = 0; if ($total &lt; $start + 10) $end = $total; else $end = $start + 10; $usersd = mysql_query(&quot;SELECT * FROM `users` ORDER BY `id` ASC LIMIT $start, $end&quot;); while($userq = mysql_fetch_array($usersd)){ echo &quot;&lt;div class=box&gt; &lt;a href=&#039;anketa.php?id=&quot;.$userq&#91;&#039;id&#039;].&quot;&#039;&gt;&quot;.$userq&#91;&#039;login&#039;].&quot;&lt;/a&gt;&lt;/div&gt;\n&quot;; } pages($start, $total, &#039;users.php&#039;, 10); ?&gt; </pre> https://visavi.net/topics/1611/52840 Навигация Nu3oN Sun, 11 Oct 2009 02:40:03 +0400 Сообщения https://visavi.net/topics/1611/52840 <pre class="prettyprint"> &lt;?php $asd = $start-($onpage*3); $asd2 = $start+($onpage*4); if($asd&lt;$total &amp;&amp; $asd&gt;0) echo &#039; &lt;a href=&quot;&#039;.$page.&#039;?start=0&quot;&gt;1&lt;/a&gt; ... &#039;; for($i=$asd; $i&lt;$asd2;){ if($i&lt;$total &amp;&amp; $i&gt;=0){ $ii = floor(1+$i/$onpage); if ($start==$i) echo &#039; &lt;b&gt;&#91;&#039;.$ii.&#039;]&lt;/b&gt;&#039;; else echo &#039; &lt;a href=&quot;&#039;.$page.&#039;?start=&#039;.$i.&#039;&quot;&gt;&#039;.$ii.&#039;&lt;/a&gt;&#039;; } $i=$i+$onpage; } if($asd2&lt;$total) echo &#039; ... &lt;a href=&quot;&#039;.$page.&#039;?start=&#039;.$ba2.&#039;&quot;&gt;&#039;.$ba.&#039;&lt;/a&gt;&#039;; } } ?&gt; </pre> https://visavi.net/topics/1611/52839 Навигация Nu3oN Sun, 11 Oct 2009 02:39:11 +0400 Сообщения https://visavi.net/topics/1611/52839 Короче не могу понять че такое!<br> короче должно выводится по 10 юзеров на страницу!<br> Все выводится как надо, но на второй странице их выводится аж 20<br> <pre class="prettyprint"> &lt;?php function pages($start, $total, $page, $onpage){ if ($start != 0) echo &#039;&lt;a href=&quot;&#039;.$page.&#039;?start=&#039;.($start - $onpage).&#039;&quot;&gt;&lt;-Назад&lt;/a&gt; &#039;; else echo &#039;&lt;-Назад&#039;; echo &#039; | &#039;; if ($total &gt; $start + $onpage) echo &#039; &lt;a href=&quot;&#039;.$page.&#039;?start=&#039;.($start + $onpage).&#039;&quot;&gt;Далее-&gt;&lt;/a&gt;&#039;; else echo &#039;Далее-&gt;&#039;; if($total&gt;0){ $ba = ceil($total/$onpage); $ba2 = $ba*$onpage-$onpage; echo &#039;&lt;br/&gt;Страницы&#58;&#039;; ?&gt; </pre> https://visavi.net/topics/1611/52838 Навигация Nu3oN Sun, 11 Oct 2009 02:38:04 +0400 Сообщения https://visavi.net/topics/1611/52838