|
Posted by Rich on 05/26/06 20:28
On 25 May 2006 12:48:33 -0700, guttyguppy@gmail.com wrote...
>
>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?
>
The link he gave you points to a deprecated function, but also shows what you
can change that to. Looked like you can do it from the mysql_query() function..
e.g. $result = mysql_query("SHOW COLUMNS FROM sometable");
Rich
--
Unlimited Newsgroup Downloads / $19.95 month
More Details - http://newsguy.com/overview.htm
Navigation:
[Reply to this message]
|