0

I have an array with a list of column names in it. I want to retrieve data from the columns in a database table by getting the column names from my array. I have tried the following but I get the error:

Notice: Undefined property: stdClass:

My code:

       while($row = $dateResult->fetch_object()) {

            echo "<tr>";
            for($k=0; $k<count($collumnNames); $k++) {

                echo "<td>";                    
                echo $row->$collumnNames[$k];           
                echo "</td>";

            }
            echo "</tr>";

        }
Cœur
  • 37,241
  • 25
  • 195
  • 267
mickzer
  • 5,958
  • 5
  • 34
  • 57

0 Answers0