I have a database which holds the tables:
fish (values are name, image, information, cooking_type_id) and cooking_type (values are cooking_type_id, thumbnail)
I've created a very simple mysqli query to display the data from the first table, but I want to display the thumbnail according to the id.
So for cooking_type maybe "Grill" has a cooking_type_id of 1. The fish "Cod" is suitable for grilling therefor it holds the value 1 under "type_id".
Instead of the displaying the "1" how do I display the thumbnail?
Here's my query code:
$query = "SELECT * FROM `fish`";
$result = $mysqli->query($query);
$mysqli->set_charset("utf8");
while($row = mysqli_fetch_array($result)){
echo '<div class="row" style="background-color:#fff;">';
echo '<div class="col-sm-2">';
echo '<div class="listphoto">';
echo $row['image'];
echo '</div></div>';
echo '<div class="col-sm-2">';
echo '<div class="listtext"><h3>';
echo $row['name'];
echo '</h3></div></div>';
echo '<div class="col-sm-2">';
echo '<div class="typephoto">';
echo $row['type_id'];
echo '</div></div>';
echo '</div>';
}
mysqli_close($conn);