You are here: Re: Get the name of the column « PHP Programming Language « IT news, forums, messages
Re: Get the name of the column

Posted by Jeremy on 10/30/07 19:24

Jorge Reyes wrote:
> hi there, this is very useful for me, so my issue is, when i use a
> $result = sybase_query("sp_something")
> while($r = sybase_fetch_array($result)) {
> etc.....
>
> how can i get the name of the columns? for example for the raw data
>
> Col1 Col2 Col3
> -------------------------------------
> hi 15 other value
>
>
> how can i get the values "Col1", "Col2", "Col3"....
> please, thanks for advanced.
>

The fetch_array functions return an associative array, where the keys
are the column names. So to get an array of the column names, you can
use the array_keys function:

$keys = array_keys($result);

More info:
http://us3.php.net/manual/en/function.array-keys.php

Jeremy

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация