I want to show a default image if there isn't any record on the table of images. I am using this one, but it shows nothing when the db's table is empty.

```
<img class="image--cover" id="blah" src="<?php echo $row2['img_local']; ?>" alt="Avatar" title="DEFINIDA" onerror="this.onerror=null;this.src='1.png';">

```

Actually, it doesn't even shows some broken image icon, not even the allocated space for this element. Any thoughts?

Edit: this is the "upload.php" code that i am using to upload the images

```
    <?php
session_start();
    include('includes/conexao.php');
    $fileinfo=PATHINFO($_FILES["image"]["name"]);
    $newFilename=$fileinfo['filename'] ."_". time() . "." . $fileinfo['extension'];
    move_uploaded_file($_FILES["image"]["tmp_name"],"images/perfis/" . $newFilename);
    $location="images/perfis/" . $newFilename;

$todas_fotos = mysqli_query($conexao, "select * FROM esc_usuarios_fotos WHERE img_usu_codigo = '" . $_SESSION['codigo'] . "'");

if( mysqli_num_rows($todas_fotos) > 0) {
        //$path=$location;
        //if(unlink($path)) echo "Deleted file ";
        mysqli_query($conexao,"UPDATE esc_usuarios_fotos SET img_local = '$location' WHERE img_usu_codigo = '" . $_SESSION['codigo'] . "'");
}
else
{
        mysqli_query($conexao,"insert into esc_usuarios_fotos (img_local, img_usu_codigo) values ('$location', '" . $_SESSION['codigo'] . "')");
};

    header('location:perfil.php');
?>

```