1

这是我从 mysql 数据库中检索图像的 php。我想调整图像大小-

<?php
$con = mysql_connect('db', 'table', 'p/w');
if (!$con) { die('Could not connect: ' . mysql_error()); } 
mysql_select_db("db", $con); 
$result = mysql_query("SELECT * FROM computers WHERE KEYWORDS='Computers'");
echo "<table border='1' width='100%' >"; 
while($row = mysql_fetch_array($result)) { 
    echo "<tr>";
    echo "<td><img src='folder_name/".$row['image_name']."'></td>";
    echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>

任何人都可以帮忙吗?谢谢

4

1 回答 1

2

您只是希望图像以特定尺寸显示吗?然后在 HTML 中输入:

echo "<td><img src=\"folder_name/{$row['image_name']}\" width=\"100\" height=\"100\" /></td>";
于 2012-04-09T04:36:59.223 回答