$read2 = "SELECT * FROM `elmtree_transactions` WHERE sellerid ='$sellerid'";
if ($result2 = $conn->query($read2)) {
while ($row2 = $result2->fetch_assoc()) {
$rating = $row2['rating'];
}
}
echo "
<div class='col-sm-3 pt-3'>
<div class='card'>
<div class='card-header'>
<strong>$user</strong><br>
Seller Rating : $rating / 5 <img src='/elmtree/images/star.png' class=' img-rating' />
</div>
";
Set up a seller rating. If the seller has a rating in the MySQL table it displays it on the page. If they don't it throws an error cause the $rating
var to be undefined, which causes the webpage to look broken. Would like to be bale to manage this and show 0/5 or "seller has no rating yet" when no rating is in the MySQL table