Connecting Tech Pros Worldwide Help | Site Map

Counting Database Fields

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 11th, 2006, 05:55 PM
TristaSD
Guest
 
Posts: n/a
Default Counting Database Fields

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, 09:25 PM
Colin McKinnon
Guest
 
Posts: n/a
Default 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.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.