<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум PHP-MyAdmin.RU &mdash; ошибка Undefined index: что делать???]]></title>
	<link rel="self" href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=984&amp;type=atom" />
	<updated>2008-11-26T12:13:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=984</id>
		<entry>
			<title type="html"><![CDATA[Re: ошибка Undefined index: что делать???]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=6310#p6310" />
			<content type="html"><![CDATA[<p><strong>kleonik</strong><br />Переместите, пожалуйста, ваш вопрос в другую ветку форума. Здесь он не уместен и будет удалён.</p>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2008-11-26T12:13:01Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=6310#p6310</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[ошибка Undefined index: что делать???]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=6305#p6305" />
			<content type="html"><![CDATA[<p>Возникают ошибки, помогите разобраться в чем дело??</p><p>PHP Notice:&nbsp; Undefined index:&nbsp; page in D:\mbrr.spb.ru\html\www\qnews.php on line 8<br />PHP Notice:&nbsp; Undefined index:&nbsp; y in D:\mbrr.spb.ru\html\www\qnews.php on line 9<br />PHP Notice:&nbsp; Undefined index:&nbsp; m in D:\mbrr.spb.ru\html\www\qnews.php on line 10</p><p>сам код:</p><p>&lt;?php<br />&nbsp; &nbsp; require_once(&quot;config.php&quot;);</p><p>&nbsp; &nbsp; $newspp = 10;</p><p>&nbsp; &nbsp; $page = (int)trim($_GET[&#039;page&#039;]);<br />&nbsp; &nbsp; $year = (int)trim($_GET[&#039;y&#039;]);<br />&nbsp; &nbsp; $month = (int)trim($_GET[&#039;m&#039;]);<br />&nbsp; &nbsp; $dblink = mysql_connect($dbhost, $dbuser, $dbpasswd) or $error=&quot;Could not connect to database&lt;br&gt;&quot;;<br />&nbsp; &nbsp; mysql_select_db($dbname,$dblink) or $error.=&quot;Could not select database&lt;br&gt;&quot;;</p><p>&nbsp; &nbsp; if ($page) $fst = ($page-1)*$newspp; else $fst = 0;<br />&nbsp; &nbsp; $limit = (!$max)? $newspp : $max;</p><p>&nbsp; &nbsp; if ($year &gt; 1970 &amp;&amp; $year &lt; 2100 &amp;&amp; $month &lt; 13 &amp;&amp; $month &gt; 0){<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot;SELECT id,datey,datem,dated,abstr FROM news WHERE (datey=&#039;$year&#039; AND datem=&#039;$month&#039;) ORDER BY datey DESC, datem DESC, dated DESC LIMIT $fst, $limit&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql2 = &quot;SELECT COUNT(*) FROM news WHERE (datey=&#039;$year&#039; AND datem=&#039;$month&#039;)&quot;;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; else if ($year &gt; 1970 &amp;&amp; $year &lt; 2100){<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot;SELECT id,datey,datem,dated,abstr FROM news WHERE (datey=&#039;$year&#039;) ORDER BY datey DESC, datem DESC, dated DESC LIMIT $fst, $limit&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql2 = &quot;SELECT COUNT(*) FROM news WHERE (datey=&#039;$year&#039;)&quot;;<br />&nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot;SELECT id,datey,datem,dated,abstr FROM news ORDER BY datey DESC, datem DESC, dated DESC LIMIT $fst, $limit&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql2 = &quot;SELECT COUNT(*) FROM news&quot;;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; $result = mysql_query($sql);<br />&nbsp; &nbsp; if ( !$max ){<br />&nbsp; &nbsp; &nbsp; &nbsp; $result2 = mysql_query($sql2);<br />&nbsp; &nbsp; &nbsp; &nbsp; list($n_all)=@mysql_fetch_row($result2);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; while (list($id, $datey, $datem, $dated, $abstr)=@mysql_fetch_row($result))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr valign=&quot;top&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&lt;td width=&quot;64&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table width=&quot;100%&quot; bgcolor=&quot;#EDEADA&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; style=&quot;font-size: 12px; color: #5E5E5E;&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td height=&quot;18&quot; align=&quot;center&quot; class=&quot;qnews_date&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?=date(&quot;d.m.Y&quot;,strtotime($datey.&quot;-&quot;.$datem.&quot;-&quot;.$dated))?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&lt;td class=&quot;qnews&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?=$abstr?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;br&gt;&lt;img src=&quot;/images/arrow.gif&quot; alt=&quot;&quot; width=&quot;7&quot; height=&quot;5&quot; border=&quot;0&quot;&gt; &lt;a href=&quot;/news/?more=&lt;?=$id?&gt;&quot; class=&quot;about&quot;&gt;Подробнее&lt;/a&gt;&lt;br&gt;&lt;br&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&lt;? } ?&gt;<br />&lt;?php<br />&nbsp; &nbsp; if (!$max &amp;&amp; $n_all &gt; $newspp) {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (!$page) $page = 1;?&gt;<br />&lt;tr&gt;<br />&nbsp; &nbsp; &lt;td align=&quot;right&quot; colspan=&quot;2&quot; class=&quot;about&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=&quot;.?page=1&quot; class=&quot;about&quot;&gt;&lt;&lt;&lt;/a&gt;<br />&lt;?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i = 0; $i &lt; $n_all/$newspp; $i++){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($i == ($page-1)) { ?&gt; | &lt;?=($i+1)?&gt; | &lt;? } else {?&gt; | &lt;a href=&quot;.?page=&lt;?=($i+1)?&gt;&quot; class=&quot;about&quot;&gt;&lt;?=($i+1)?&gt;&lt;/a&gt; | &lt;? } ?&gt;<br />&lt;?php&nbsp; &nbsp; &nbsp; &nbsp; } ?&gt;<br />&nbsp; &nbsp; | &lt;a href=&quot;.?page=&lt;?=(int)($n_all/$newspp+1)?&gt;&quot; class=&quot;about&quot;&gt;&gt;&gt;&lt;/a&gt;<br />&nbsp; &nbsp; &lt;/td&gt;<br />&lt;/tr&gt;<br />&lt;?php<br />&nbsp; &nbsp; } ?&gt;</p>]]></content>
			<author>
				<name><![CDATA[kleonik]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=1635</uri>
			</author>
			<updated>2008-11-26T07:14:56Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=6305#p6305</id>
		</entry>
</feed>
