Pergunta

I need to set smaller dimensions as all images are different sizes and need one small size so the page does not stretch, however whenever i add width and height dimensions i keep getting php errors.

Just need width and height for img.

while ($res = mysql_fetch_array($action)) {
    $output = "<img src=\"../admin/inventory_images/{$res['id']}.jpg\"></img><a href=\"product.php?id={$res['id']}\">{$res['product_name']}</a><br />";
    echo $output;
}
Foi útil?

Solução

Just put them in your <img> tag as normal:

$output = "<img src=\"../admin/inventory_images/{$res['id']}.jpg\" height=\"100\" width=\"100\"><a href=\"product.php?id={$res['id']}\">{$res['product_name']}</a><br />";
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top