#1
  1. Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    49
    Rep Power
    15
    Hi,

    At the moment i'm trying to do a function to retrieve data and place it in an HTML table.

    I was going to try to generate the table dynamically depending on the amount of columns in the table being searched. This would basically mean having the first row of the table with the names of the MySQL fields in them.

    FOr example, I have several tables in a database, each with a different amount of data fields. I would like to generate an HTML table with the amount of columns contained in that MySQL table, headed with the names of those MySQL data fields, and containing the results of the query passed into that MySQL table....

    DO you know of a way of doing this ? At the moment I am using a DB access class similar to that described in the "Accessing Databases with Class" article on this site....
    but i haven't found a way of retrieving the columns names of the table columns.... Any ideas ?

    -nick
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    see mysql_fetch_fields() in the PHP manual

Similar Threads

  1. need help in sorting&printing MySQL results
    By lowdog in forum MySQL Help
    Replies: 0
    Last Post: February 16th, 2004, 10:23 AM
  2. Can anyone help with mysql query and results?
    By msmith29063 in forum MySQL Help
    Replies: 3
    Last Post: February 8th, 2004, 03:43 AM
  3. MySQL Select query
    By MrTee1 in forum MySQL Help
    Replies: 0
    Last Post: January 30th, 2004, 11:16 AM
  4. MySQL tables location
    By RodrigoRosa in forum MySQL Help
    Replies: 8
    Last Post: January 28th, 2004, 07:05 PM
  5. POST results in BLANK HTML page
    By MO_PAshun in forum PHP Development
    Replies: 5
    Last Post: January 24th, 2004, 01:19 AM

IMN logo majestic logo threadwatch logo seochat tools logo