Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

outputting array from mysql?

  • 15-10-2005 10:09pm
    #1
    Registered Users, Registered Users 2 Posts: 2,015 ✭✭✭


    Is there any simple way to output the entire array in a mysql query in php to an HTML table without having the reference the fieldnames individually?

    I've got an screen where the user dynamically selects fields, (there are 30+ fields) and then returns the results to a table.

    I could of course code a couple of dozen variables for this, but surely there's a better way?


Comments

  • Registered Users, Registered Users 2 Posts: 5,333 ✭✭✭Cake Fiend


    [php]
    echo "<table>";
    foreach( $array as $var )
    {
    echo "<tr><td>";
    echo $var;
    echo "</td></tr>";
    //any other stuff
    }
    echo "</table>";
    [/php]


Advertisement