Hi guys,
I've inserted in my database and folder a specific photo for profile. Now i want to verify if the photo is added in database and if it is display it, and if is not display a default photo.
The code that i've used to show the photo is below, now i can't manage to do the secound part, wich is to display a default photo if there is none in database.
<?php
if ($result = $mysqli->query("SELECT profile_image FROM bonacuora_clients WHERE id='$id'")) {
while($row = mysqli_fetch_array($result))
{
echo "<img src='photos/" . $row['profile_image'] . "' class='media-object img-circle' width='180' height='180'>";
}
}
?>
Any suggestion?