<?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=1207&amp;type=atom" />
	<updated>2009-04-26T14:19:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=1207</id>
		<entry>
			<title type="html"><![CDATA[Re: Проблема с выводом таблицы]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=7971#p7971" />
			<content type="html"><![CDATA[<p>Огромное спасибо! Выручил! То что нужно! <img src="https://forum.php-myadmin.ru/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; Будешь на Дальнем Востоке обязательно заходи, с меня пиво!</p>]]></content>
			<author>
				<name><![CDATA[Viacheslav]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=1962</uri>
			</author>
			<updated>2009-04-26T14:19:03Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=7971#p7971</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Проблема с выводом таблицы]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=7967#p7967" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Hanut]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=181</uri>
			</author>
			<updated>2009-04-26T11:12:14Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=7967#p7967</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Проблема с выводом таблицы]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=7964#p7964" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Viacheslav]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=1962</uri>
			</author>
			<updated>2009-04-26T04:34:09Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=7964#p7964</id>
		</entry>
</feed>
