这是我的php从mysql数据库中检索图像。我想调整图像大小 -
<?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);
?>
有人可以帮忙吗? 感谢
答案 0 :(得分:2)
您是否希望图像以特定尺寸显示?然后在HTML中输入:
echo "<td><img src=\"folder_name/{$row['image_name']}\" width=\"100\" height=\"100\" /></td>";