Re: How do I fetch an array of all field names in a mysql database?
- From: guttyguppy@xxxxxxxxx
- Date: 25 May 2006 12:48:33 -0700
Thanks for the lead-the manual is so huge and tough to read that I gave
up the first time, but now I think I've got it:
$query="SELECT * FROM my_table";
$result=mysql_query($query);
$i = 0;
while ($i < mysql_num_fields($result)) {
$meta = mysql_fetch_field($result, $i);
echo $meta->name."</br>\n";
$i++;
}
Is that good, non-depracated code though?
.
- Follow-Ups:
- References:
- How do I fetch an array of all field names in a mysql database?
- From: guttyguppy
- Re: How do I fetch an array of all field names in a mysql database?
- From: guttyguppy
- Re: How do I fetch an array of all field names in a mysql database?
- From: Erlend Klakegg Bergheim
- How do I fetch an array of all field names in a mysql database?
- Prev by Date: PHP5 DOM saveHTML() vs. saveXML()
- Next by Date: Re: How do I fetch an array of all field names in a mysql database?
- Previous by thread: Re: How do I fetch an array of all field names in a mysql database?
- Next by thread: Re: How do I fetch an array of all field names in a mysql database?
- Index(es):