Connecting Tech Pros Worldwide Help | Site Map

Counting Database Fields

  #1  
Old May 11th, 2006, 06:55 PM
TristaSD
Guest
 
Posts: n/a
I am trying to build a sortable list of rows pulled from MySQL. I need
a programmatic header that would allow sorting of records. Because
order in which the fields are displayed might change, I need to learn
how to refer to field names programmatically.

Thanks!

  #2  
Old May 11th, 2006, 10:25 PM
Colin McKinnon
Guest
 
Posts: n/a

re: Counting Database Fields


TristaSD wrote:
[color=blue]
> I am trying to build a sortable list of rows pulled from MySQL. I need
> a programmatic header that would allow sorting of records. Because
> order in which the fields are displayed might change, I need to learn
> how to refer to field names programmatically.
>[/color]

if you do mysql_fetch_assoc() you'll get an associative array where the keys
are the attributes from the query.

You can also treat the output of 'DESC mytable' in much the same way you
would 'SELECT fld1, other FROM some_data'

HTH

C.

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database design question MP answers 29 January 5th, 2006 02:35 PM
Counting Problem Megan answers 3 November 13th, 2005 02:41 AM
Pronblem Counting occurrences regardless of field Glenn Cornish answers 2 November 12th, 2005 04:51 PM
Is it safe to reuse control names in text fields? Paul Morrow answers 9 July 20th, 2005 07:33 PM