Hi Everyone, I have the following script / select that is displaying all fields from my database - But only if i use {$row->field_name} in the output while loop -
$stmt = $conn->prepare("SELECT * FROM tbl ORDER BY id DESC");
$stmt->execute();
$total = $stmt->rowCount();
while ($row = $stmt->fetchObject()) {
//$opvar = $row['mchq_var'];
echo "
<tr>
<td>{$row->mchq_var}</td>
</tr>
";
How would it be possible for me to use the $opvar variable in the table row instead of having to use {$row->mchq_var}
What is it that I am missing?
Thanks