|
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]
|