<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум PHP-MyAdmin.RU &mdash; подскажите у меня проблема с постраничной навигацией вот код]]></title>
	<link rel="self" href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=1413&amp;type=atom" />
	<updated>2009-10-08T07:04:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=1413</id>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9368#p9368" />
			<content type="html"><![CDATA[<p>большое спасибо за помощь</p>]]></content>
			<author>
				<name><![CDATA[bilter]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=2298</uri>
			</author>
			<updated>2009-10-08T07:04:35Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9368#p9368</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9365#p9365" />
			<content type="html"><![CDATA[<p><strong>bilter</strong><br />Ошибка означает, что оператору LIMIT задано отрицательное число, что запрещено. Посмотрите внимательнее как формируется переменная $start.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2009-10-07T08:43:59Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9365#p9365</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9364#p9364" />
			<content type="html"><![CDATA[<p>спасибо я вставил в код но теперь выскакивает вот это<br />You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;-7, 7&#039; at line 1</p>]]></content>
			<author>
				<name><![CDATA[bilter]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=2298</uri>
			</author>
			<updated>2009-10-06T22:08:36Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9364#p9364</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9363#p9363" />
			<content type="html"><![CDATA[<p><strong>bilter</strong><br /></p><div class="codebox"><pre><code>// Проверьте ошибку возвращаемую MySQL. После 37 строки добавьте:
if (!$result) exit(mysql_error());

// И еще одну строку надо добавить перед do, иначе первый цикл будет с пустыми переменными:
$myrow = mysql_fetch_array ($result);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2009-10-06T21:46:48Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9363#p9363</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9362#p9362" />
			<content type="html"><![CDATA[<p>while ($myrow = mysql_fetch_array ($result));</p><p><span style="color: #808080"><em>Сообщение добавлено Tue Oct&nbsp; 6 23:02:06 2009</em></span><br />я даже не знаю в чем здесь проблема вроде все ок а все равно выдает ошибку</p>]]></content>
			<author>
				<name><![CDATA[bilter]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=2298</uri>
			</author>
			<updated>2009-10-06T18:58:41Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9362#p9362</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9361#p9361" />
			<content type="html"><![CDATA[<p>вот здесь&nbsp; Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in Z:\home\localhost\www\phpsite\medical_articles.php on line 52</p>]]></content>
			<author>
				<name><![CDATA[bilter]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=2298</uri>
			</author>
			<updated>2009-10-06T18:47:33Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9361#p9361</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9360#p9360" />
			<content type="html"><![CDATA[<p><strong>bilter</strong><br />В чем именно проблема? Если выводятся ошибки, то какие? Если что-то не работает, то что именно?</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2009-10-06T14:19:11Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9360#p9360</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[подскажите у меня проблема с постраничной навигацией вот код]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=9359#p9359" />
			<content type="html"><![CDATA[<p>&lt;?php <br />include (&quot;blocks/bd.php&quot;);<br />$result = mysql_query (&quot;SELECT id,title,description,author,date FROM medical_articles&quot;,$db);<br />$myrow = mysql_fetch_array ($result);<br />&nbsp; ?&gt;<br />&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>&quot;&gt;<br />&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />&lt;head&gt;<br />&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1251&quot; /&gt;<br />&lt;title&gt;&lt;?php echo $myrow[&#039;title&#039;]; ?&gt;&lt;/title&gt;<br />&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;&lt;/head&gt;<br />&lt;meta name=&quot;keywords&quot; content=&quot;&lt;?php echo $myrow[&#039;meta_k&#039;]; ?&gt; &quot; /&gt;<br />&lt;meta name=&quot;description&quot; content=&quot;&lt;?php echo $myrow[&#039;meta_d&#039;]; ?&gt;&quot; /&gt;<br />&lt;body&gt;<br />&lt;table width=&quot;860&quot; border=&quot;0&quot; align=&quot;center&quot; class=&quot;main_border&quot;&gt;<br /> &lt;? include (&quot;blocks/header.php&quot;);&nbsp; &nbsp;?&gt;<br />&nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &lt;td height=&quot;219&quot;&gt;&lt;table width=&quot;860&quot; border=&quot;0&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;? include (&quot;blocks/lefttd.php&quot;) ;&nbsp; &nbsp;?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&quot;660&quot; valign=&quot;top&quot; bgcolor=&quot;#F6F6F6&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;&lt;?php echo $myrow[&#039;text&#039;]; ?&gt;&lt;/p&gt;<br />&nbsp; &nbsp;&lt;?php&nbsp; &nbsp;<br />$result77 = mysql_query(&quot;SELECT str FROM options&quot;, $db);<br />$myrow77 = mysql_fetch_array($result77);<br />$num = $myrow77[&quot;str&quot;];<br />@$page = $_GET[&#039;page&#039;];<br />$result00 = mysql_query(&quot;SELECT COUNT(*) FROM medical_articles WHERE id=&#039;$id&#039;&quot;);<br />$temp = mysql_fetch_array($result00);<br />$posts = $temp[0];<br />$total = (($posts - 1) / $num) + 1;<br />$total =&nbsp; intval($total);<br />$page = intval($page);<br />if(empty($page) or $page &lt; 0) $page = 1;<br />if($page &gt; $total) $page = $total;<br />$start = $page * $num - $num;<br />$result = mysql_query(&quot;SELECT id,title,description,date,author FROM medical_articles WHERE id=&#039;$id&#039; ORDER BY id LIMIT $start, $num&quot;,$db);<br />&nbsp; do <br />&nbsp; {&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf (&quot;&lt;table align=&#039;center&#039; class=&#039;articles&#039;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#039;articles_title&#039;&gt;&lt;p class=&#039;articles_name&#039;&gt;&lt;a href=&#039;view3_articles.php?id=%s&#039;&gt;%s&lt;/a&gt;&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&#039;articles_adds&#039;&gt;Дата добавления: %s&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p class=&#039;articles_adds&#039;&gt;Автор статьи: %s&lt;/p&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;%s&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/table&gt;&lt;br&gt;&lt;br&gt;&quot;,$myrow[&quot;id&quot;], $myrow[&quot;title&quot;], $myrow[&quot;date&quot;],&nbsp; $myrow[&quot;author&quot;], $myrow[&quot;description&quot;] );&nbsp; &nbsp;&nbsp; &nbsp;<br />}&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<br />while ($myrow = mysql_fetch_array ($result));&nbsp; &nbsp; <br />if ($page != 1) $pervpage = &#039;&lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=1&gt;Первая&lt;/a&gt; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page - 1) .&#039;&gt;Предыдущая&lt;/a&gt; | &#039;;<br />if ($page != $total) $nextpage = &#039; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page + 1) .&#039;&gt;Следующая&lt;/a&gt; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039; .$total. &#039;&gt;Последняя&lt;/a&gt;&#039;;<br />if($page - 5 &gt; 0) $page5left = &#039; &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page - 5) .&#039;&gt;&#039;. ($page - 5) .&#039;&lt;/a&gt; | &#039;;<br />if($page - 4 &gt; 0) $page4left = &#039; &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page - 4) .&#039;&gt;&#039;. ($page - 4) .&#039;&lt;/a&gt; | &#039;;<br />if($page - 3 &gt; 0) $page3left = &#039; &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page - 3) .&#039;&gt;&#039;. ($page - 3) .&#039;&lt;/a&gt; | &#039;;<br />if($page - 2 &gt; 0) $page2left = &#039; &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page - 2) .&#039;&gt;&#039;. ($page - 2) .&#039;&lt;/a&gt; | &#039;;<br />if($page - 1 &gt; 0) $page1left = &#039;&lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page - 1) .&#039;&gt;&#039;. ($page - 1) .&#039;&lt;/a&gt; | &#039;;<br />if($page + 5 &lt;= $total) $page5right = &#039; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page + 5) .&#039;&gt;&#039;. ($page + 5) .&#039;&lt;/a&gt;&#039;;<br />if($page + 4 &lt;= $total) $page4right = &#039; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page + 4) .&#039;&gt;&#039;. ($page + 4) .&#039;&lt;/a&gt;&#039;;<br />if($page + 3 &lt;= $total) $page3right = &#039; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page + 3) .&#039;&gt;&#039;. ($page + 3) .&#039;&lt;/a&gt;&#039;;<br />if($page + 2 &lt;= $total) $page2right = &#039; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page + 2) .&#039;&gt;&#039;. ($page + 2) .&#039;&lt;/a&gt;&#039;;<br />if($page + 1 &lt;= $total) $page1right = &#039; | &lt;a href=view3_articles.php?id=&#039;.$id.&#039;&amp;page=&#039;. ($page + 1) .&#039;&gt;&#039;. ($page + 1) .&#039;&lt;/a&gt;&#039;;<br />if ($total &gt; 1)<br />{<br />Error_Reporting(E_ALL &amp; ~E_NOTICE);<br />echo &quot;&lt;div class=\&quot;pstrnav\&quot;&gt;&quot;;<br />echo $pervpage.$page5left.$page4left.$page3left.$page2left.$page1left.&#039;&lt;b&gt;&#039;.$page.&#039;&lt;/b&gt;&#039;.$page1right.$page2right.$page3right.$page4right.$page5right.$nextpage;<br />echo &quot;&lt;/div&gt;&quot;;<br />}<br />?&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/table&gt;&lt;/td&gt;<br />&nbsp; &lt;/tr&gt;<br />&nbsp; &lt;? include (&quot;blocks/footer.php&quot;) ;&nbsp; ?&gt;<br />&lt;/table&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;</p>]]></content>
			<author>
				<name><![CDATA[bilter]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=2298</uri>
			</author>
			<updated>2009-10-06T11:48:45Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=9359#p9359</id>
		</entry>
</feed>
