Counting Database Fields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TristaSD

    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 programmaticall y.

    Thanks!

  • Colin McKinnon

    #2
    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 programmaticall y.
    >[/color]

    if you do mysql_fetch_ass oc() 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.

    Comment

    Working...