Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2005
    Posts
    190
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Printing the mysql database variable names

    Hi
    Currently im using the code below to print the database values in a table. But what this doesnt show is the variable names (ie. column names).

    Anybody know a way I can do this?

    Thanks

    PHP Code:
    print "<table border=1>\n"
    while (
    $get_info mysql_fetch_row($result)){ 
    print 
    "<tr>\n"
    foreach (
    $get_info as $field
    print 
    "\t<td><font face=arial size=1/>$field</font></td>\n";
      
    print 
    "</tr>\n";

    print 
    "</table>\n"

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,020
    Thanks
    2
    Thanked 313 Times in 305 Posts
    See this recent thread - Putting data into a table
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •