I\'d like to get all of a mysql table\'s col names into an array in php?
Is there a query for this?
Use mysql_fetch_field() to view all column data. See manual.
$query = 'select * from myfield';
$result = mysql_query($query);
$i = 0;
while ($i < mysql_num_fields($result))
{
$fld = mysql_fetch_field($result, $i);
$myarray[]=$fld->name;
$i = $i + 1;
}
"Warning This extension is deprecated as of PHP 5.5.0, and will be removed in the future."