custom image when blob does not exist (404) : <p>I have a php page that has blobs from my database</p>

<p>i need 404 image to display when there is no blob</p>

<p><a href="https://i.imgur.com/gp0Q2kQ.jpg" rel="nofollow noreferrer">https://i.imgur.com/gp0Q2kQ.jpg</a>
<a href="https://i.imgur.com/XgGDExK.jpg" rel="nofollow noreferrer">https://i.imgur.com/XgGDExK.jpg</a></p>

<pre><code>&lt;?php
$host = "localhost";
$username = "root";
$password = "12345678";
$db = "sis";
$PicNum = $_GET["PicNum"];

mysql_connect($host,$username,$password) or die("Impossível conectar ao banco."); 
@mysql_select_db($db) or die("Impossível conectar ao banco."); 
$result=mysql_query("SELECT * FROM usuarios WHERE id=$PicNum") or die("Impossível executar a query "); 
$row=mysql_fetch_object($result); 

Header("Content-type: image/gif"); 
echo $row-&gt;avatar;?&gt;
</code></pre>
