You are here: Re: How do I fetch an array of all field names in a mysql database? « All PHP « IT news, forums, messages
Re: How do I fetch an array of all field names in a mysql database?

Posted by guttyguppy on 09/28/13 11:48

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?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация