I have other examples here but none worked for me
I have an instruction to pull an image from the database, but it is giving the error
"Notice: Trying to get property of non-object in ...";
$q= $db->Select("produto", "nome, imagem", "WHERE id = 21 AND masterid = 100");
if($q){
$prod= mysqli_fetch_assoc($q);
$thumb = $prod->imagem;
}
What do I do to fix it?
Notice: Trying to get property of non-object in /home/.../.../public_html/system/.../.../.../header.php on line 6 [SOLVED THE PROBLEM ABOVE]
Another thing, guys.
Solved the above problem on Non-object, I want to pass the value of this variable:
$thumb = str_replace("../", "http://www.siteexemplohere.com/", ($prod['imagem']));
That is, the value of $ thumb, for:
<meta property="og:image" content="<?php echo $thumb ? $thumb : " <?php echo $Raiz; ?>/assets/img/thumbs/default.png "; ?>"/>
Because I want the user to click on the Facebook share button, the sharing box appears in the Product image + product description (that's cool);
I followed the documentation and it does not work ... Thanks for the help you are giving me ... Each tip an idea to formulate another problem solution
Remembering that when I give a var_dump (), it is taking the bank normally, I have already done the var_dump of the $ thumb after being taken from the bank and then inserted into the "meta".