dimanche 6 mars 2016

image source in Laravel 5

I have a table in my database named internet_shop that contains the products of the shop and I want to display them all. I am using Laravel 5 but i am having a small problem with quotations in the following code:

$result = mysql_query("SELECT * FROM internet_shop");//select all the products
while($row=mysql_fetch_assoc($result))
{
    echo '<div class="product"> <img src="{{ asset('img/products/').'/'.$row['img']}}" alt="'.htmlspecialchars($row['name']).'" width="128" height="128" class="pngfix" /></div>';
}

I know my problem is in the image source, but not able to fix it. Any suggestions?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1SrTdLW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire