Jump to content

How to retrive field name from database?


nunos

Recommended Posts

Hi

 

You can use mysql_ num_ fields() and mysql_ field_ name(). This would give you an array:-

 

$fieldNameArray = array();
for($aCnt = 0;$aCnt<mysql_ num_ fields($rs);$aCnt++) $fieldNameArray[]=mysql_ field_ name($rs,$aCnt);

 

although as you can no doubt see you can get the field names anyway if you know their offset.

 

All the best

 

Keith

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.