Hi,
On command prompt, when I run the query on table bdays:
select * from bdays where 1=2
I get the column names, but # of rows effected equals 0. I am wondering how can I get the column names using php? My logic was to look at number of effected rows and number of effected fields [sybase_num_rows(), sybase_num_fields()] and get data using [sybase_fetch_row()].
Everything is good except that displayed data is without column names.
Can someone please help me. Thanks a lot,
Farzal
---------------
$result_id = sybase_query($query, $connection_id);
$numDataRows = sybase_num_rows($result_id);
$numColumns = sybase_num_fields($result_id);
for ($i=0 ; $i<$numDataRows; ++$i) {
$row = sybase_fetch_row($result_id);
foreach ($row as $value) {
echo "$value ";
}
echo "<br>";
}
-----------------
On command prompt, when I run the query on table bdays:
select * from bdays where 1=2
I get the column names, but # of rows effected equals 0. I am wondering how can I get the column names using php? My logic was to look at number of effected rows and number of effected fields [sybase_num_rows(), sybase_num_fields()] and get data using [sybase_fetch_row()].
Everything is good except that displayed data is without column names.
Can someone please help me. Thanks a lot,
Farzal
---------------
$result_id = sybase_query($query, $connection_id);
$numDataRows = sybase_num_rows($result_id);
$numColumns = sybase_num_fields($result_id);
for ($i=0 ; $i<$numDataRows; ++$i) {
$row = sybase_fetch_row($result_id);
foreach ($row as $value) {
echo "$value ";
}
echo "<br>";
}
-----------------