<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум PHP-MyAdmin.RU &mdash; Проблема с выводом таблицы]]></title>
		<link>https://forum.php-myadmin.ru/viewtopic.php?id=1207</link>
		<atom:link href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=1207&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Проблема с выводом таблицы».]]></description>
		<lastBuildDate>Sun, 26 Apr 2009 14:19:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Проблема с выводом таблицы]]></title>
			<link>https://forum.php-myadmin.ru/viewtopic.php?pid=7971#p7971</link>
			<description><![CDATA[<p>Огромное спасибо! Выручил! То что нужно! <img src="https://forum.php-myadmin.ru/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; Будешь на Дальнем Востоке обязательно заходи, с меня пиво!</p>]]></description>
			<author><![CDATA[null@example.com (Viacheslav)]]></author>
			<pubDate>Sun, 26 Apr 2009 14:19:03 +0000</pubDate>
			<guid>https://forum.php-myadmin.ru/viewtopic.php?pid=7971#p7971</guid>
		</item>
		<item>
			<title><![CDATA[Re: Проблема с выводом таблицы]]></title>
			<link>https://forum.php-myadmin.ru/viewtopic.php?pid=7967#p7967</link>
			<description><![CDATA[<p>Если я правильно понял, то так.<br /></p><div class="codebox"><pre><code>if (mysql_num_rows($result) &gt; 0) {

    print &quot;&lt;table align=&#039;center&#039; class=&#039;clients&#039;&gt;
           &lt;tr align=&#039;center&#039;  &gt;
           &lt;td class=&#039;title_td&#039;&gt;Заказчик&lt;/td&gt;
           &lt;td class=&#039;title_td&#039;&gt;Город&lt;/td&gt;
           &lt;td class=&#039;title_td&#039;&gt;Объект&lt;/td&gt;
           &lt;td class=&#039;title_td&#039;&gt;Вид работ&lt;/td&gt;
           &lt;td class=&#039;title_td&#039;&gt;Год&lt;/td&gt;
           &lt;/tr&gt;&quot;;

    while ($myrow = mysql_fetch_array($result)) {
    printf (&quot;
           &lt;tr  align=&#039;center&#039; class = &#039;client_data&#039; &gt;
           &lt;td&gt;&lt;a href=&#039;view_client.php?id=%s&#039;&gt;%s&lt;/a&gt;&lt;/td&gt;
           &lt;td&gt;%s&lt;/td&gt;
           &lt;td&gt;%s&lt;/td&gt;
           &lt;td&gt;%s&lt;/td&gt;
           &lt;td&gt;%s&lt;/td&gt;
           &lt;/tr&gt;
    &quot;,$myrow[&quot;id&quot;],$myrow[&quot;client&quot;],$myrow[&quot;location&quot;],$myrow[&quot;object&quot;],$myrow[&quot;operations&quot;],$myrow[&quot;year&quot;]);
    }

    print &#039;&lt;/table&gt;&lt;br&gt;&lt;br&gt;&#039;;

}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Hanut)]]></author>
			<pubDate>Sun, 26 Apr 2009 11:12:14 +0000</pubDate>
			<guid>https://forum.php-myadmin.ru/viewtopic.php?pid=7967#p7967</guid>
		</item>
		<item>
			<title><![CDATA[Проблема с выводом таблицы]]></title>
			<link>https://forum.php-myadmin.ru/viewtopic.php?pid=7964#p7964</link>
			<description><![CDATA[<p>Приветствую комрады! Возникла проблема с выводом таблицы используя функцию Printf .Я увидел что похожий вопрос уже обсуждался <br /><a href="http://forum.php-myadmin.ru/viewtopic.php?id=959">http://forum.php-myadmin.ru/viewtopic.php?id=959</a> но у меня немного посложней. Проблема в том что изза какойто ошибки выводятся несколько таблиц с одинаковыми заголовками и разными значениями а мне нужно получить тоже самое но чтобы в одной таблице было. Подозреваю что напутал с таблицами но не могу найти где. привожу исходный код. </p><p>&lt;?<br />echo $myrow[&#039;text&#039;];</p><p>/*заносим в массив&nbsp; поля из переменной result*/<br />$result = mysql_query(&quot;SELECT id, client, location, object, operations, year FROM clients ORDER BY id &quot;,$db);</p><br /><p>if&nbsp; (!$result) /*если в результат попала ложь*/<br />/*то выводим ошибку*/<br />{<br />echo &quot;&lt;p&gt;Запрос на выборку данных из базы не прошел!&nbsp; &lt;br&gt; &lt;strong&gt;Код ошибки&lt;/strong&gt;&lt;/p&gt;&quot;;<br />exit(mysql_error() ); /*остановим програму и выводим код ошибки*/<br />}</p><br /><p>if (mysql_num_rows($result) &gt;0 )<br />{<br />$myrow = mysql_fetch_array($result);</p><br /><p>do<br />{<br />printf (&quot;&lt;table align=&#039;center&#039; class=&#039;clients&#039;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;tr align=&#039;center&#039;&nbsp; &gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#039;title_td&#039;&gt;Заказчик&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#039;title_td&#039;&gt;Город&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#039;title_td&#039;&gt;Объект&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#039;title_td&#039;&gt;Вид работ&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#039;title_td&#039;&gt;Год&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;/tr&gt;</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&nbsp; align=&#039;center&#039; class = &#039;client_data&#039; &gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;a href=&#039;view_client.php?id=%s&#039;&gt;%s&lt;/a&gt;&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;%s&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;%s&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;%s&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;%s&lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;&lt;/tr&gt;</p><p>&lt;/table&gt;&lt;br&gt;&lt;br&gt;&quot;,$myrow[&quot;id&quot;],$myrow[&quot;client&quot;],$myrow[&quot;location&quot;],$myrow[&quot;object&quot;],$myrow[&quot;operations&quot;],$myrow[&quot;year&quot;]);</p><br /><p>}<br />while ($myrow = mysql_fetch_array($result));</p><br /><p>}</p><p>else<br />{<br />echo &quot;&lt;p&gt;Информация по запросу не может быть извлечена, в таблице нет записей.&lt;/p&gt;&quot;;<br />exit();<br />}</p><p>?&gt;</p>]]></description>
			<author><![CDATA[null@example.com (Viacheslav)]]></author>
			<pubDate>Sun, 26 Apr 2009 04:34:09 +0000</pubDate>
			<guid>https://forum.php-myadmin.ru/viewtopic.php?pid=7964#p7964</guid>
		</item>
	</channel>
</rss>
