I have set up a table that displays data from my SQL database using
$sql = "SELECT company_id, stk_buy, stk_sell FROM price";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table><tr><th>ID</th><th>Company</th><th>Buying Price</th><th>Selling Price</th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["company_id"]."</td><td>".$row["stk_buy"]."</td><td>".$row["stk_sell"]."</td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
I want to have images display in the Company column, different ones in each row. Similar to: Is there a possible way of displaying images with my current html table setup or do I have to fetch each row to display images?