Zach Brown Fri May 20 17:52:23 -0400 2011

Subject: Help with accessing indexes from result set

Is there some way to loop through all of the field names in the result set?

For example:
$result = mysql_query("SELECT * FROM `table`);
$row = mysql_fetch_assoc($result);
foreach($row as $field => val) {
echo $field;

Would give me all the field names in the table.

Is there anyway to do this with an activerecord result set?


Yoan B Sun May 22 11:39:13 -0400 2011