I’m building a database driven website using WAMP
I have database with table called userinfo with the following field names DateTime DomainName ComputerName UserName NetworkSettings.
And I have a PHP script with a HTML table
echo "<div id='tableheading'>
";
echo "<table class='data' border='1'align='center'>
";
echo "<tr>
";
echo "<th> DateTime </th>
echo "<th> DomainName </th>
echo "<th> ComputerName </th>
echo "<th> UserName </th>
echo "<th> NetworkSettings </th>
How do I get the field names straight from the database?
As you are using WAMP, I assume you're talking about MySQL. Have a look at mysqli_result::fetch_fields().
I'd advise against that