<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3162350</guid>
        <pubDate>Thu, 28 Jun 2012 22:45:48 +0000</pubDate>
        <title>Query.Как полчить имя поля по индексу поля?</title>
        <link>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3162350</link>
        <description><![CDATA[Alex2011: <strong class='tag-b'>Vicis</strong>,благодарю&#33; Именно то, что нужно.]]></description>
        <author>Alex2011</author>
        <category>Delphi for PHP</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3162064</guid>
        <pubDate>Thu, 28 Jun 2012 11:30:11 +0000</pubDate>
        <title>Query.Как полчить имя поля по индексу поля?</title>
        <link>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3162064</link>
        <description><![CDATA[vicis: Так я и думал, что вопрос не в индексах базы данных.<br>
Т.к. результат запроса находится в массиве, то и используй работу с массивами в php<br>
1. Список полей и структура массива<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; function Button1Click($sender, $params)</div><div class="code_line">&nbsp;&nbsp; {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;$xarray = $this-&#62;Query1-&#62;Fields;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;print_r($xarray);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;echo &quot;&#60;BR&#62;&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;$xcount = count($xarray);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;for($i = 1; $i &#60;= $xcount; $i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; echo key($xarray) . &quot;&#60;BR&#62;&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; next($xarray);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; }</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
2. Функци типа Query.Fields[0].FieldName<br>
   <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">function ExtractFieldName($query, $findex)</div><div class="code_line">&nbsp;&nbsp; {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;$xarray = $query-&#62;Fields;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;$xcount = count($xarray);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;if($xcount == 0)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; return &#39;&#39;;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; for($i = 0; $i &#60; $xcount; $i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if($i == $findex)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return key($xarray);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next($xarray);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; }</div><div class="code_line">&nbsp;</div><div class="code_line">....</div><div class="code_line">// вызываем так</div><div class="code_line">echo &quot;Имя поля с кодом индекса=2 (отсчёт от 0-го поля): &quot;.$this-&#62;ExtractFieldName($this-&#62;Query1, 2);</div></ol></div></div></div></div>]]></description>
        <author>vicis</author>
        <category>Delphi for PHP</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161805</guid>
        <pubDate>Wed, 27 Jun 2012 22:52:35 +0000</pubDate>
        <title>Query.Как полчить имя поля по индексу поля?</title>
        <link>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161805</link>
        <description><![CDATA[Alex2011: Имею ввиду функцию типа Query.Fields[0].FieldName,возвращающую имя поля,где 0-первое поле,1-второе и т.д. Хочется получить имя поля из свойств датасета]]></description>
        <author>Alex2011</author>
        <category>Delphi for PHP</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161415</guid>
        <pubDate>Wed, 27 Jun 2012 11:39:08 +0000</pubDate>
        <title>Query.Как полчить имя поля по индексу поля?</title>
        <link>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161415</link>
        <description><![CDATA[vicis: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=359856&view=findpost&p=3161055'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Alex2011 &#064; <time class="tag-quote__quoted-time" datetime="2012-06-27T02:46:08+00:00">27.06.12, 02:46</time></span><div class='quote '>Собственно в названии темы и есть вопрос</div></div><br>
начнём с того, что разберёмся: что ты имееш ввиду говоря про индекс поля ?]]></description>
        <author>vicis</author>
        <category>Delphi for PHP</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161063</guid>
        <pubDate>Wed, 27 Jun 2012 05:01:20 +0000</pubDate>
        <title>Query.Как полчить имя поля по индексу поля?</title>
        <link>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161063</link>
        <description><![CDATA[MIF: Зависит от типа БД. В MSSQL информацию о поляx можно получить, запросив данные из sys.indexes, sys.index_columns, sys.objects, sys.columns таблиц.]]></description>
        <author>MIF</author>
        <category>Delphi for PHP</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161055</guid>
        <pubDate>Wed, 27 Jun 2012 02:46:08 +0000</pubDate>
        <title>Query.Как полчить имя поля по индексу поля?</title>
        <link>https://forum.sources.ru/index.php?showtopic=359856&amp;view=findpost&amp;p=3161055</link>
        <description><![CDATA[Alex2011: Собственно в названии темы и есть вопрос.Не нашел соответствующих методов и свойств. Их просто нет?]]></description>
        <author>Alex2011</author>
        <category>Delphi for PHP</category>
      </item>
	
      </channel>
      </rss>
	