Hey peeps,
I’m trying to get some data from a mysql database. I’m doing a SELECT * FROM db, Storing the columns into an array and trying to print out the data associated with the columns. Here is my code. For some reason it stops at the first field set which is the Id. I could just do two separate while loops but would rather not. Any help is appreciated - Thanks.
[php]
while($fieldinfo=mysqli_fetch_field($result))
{
$row = $result->fetch_assoc();
$columnName[$columnCount] = $fieldinfo->name;
// Testing
echo $columnName[$columnCount]; // Echo’s the column names to the screen.
echo $row[$columnName[$columnCount]]; // Displays the id but nothing else.
echo $columnCount; // Dsplays results 0 - 33
echo ‘
’;
$columnCount++;
}
[/php]