我的代碼給了我一個問題:當我將信息保存到數據庫中時,格式化被保留,但是當我將信息放入textarea時,有很多額外的空間。把MySQL的信息放到textarea中,沒有多餘的空格?
Screenshoot:http://i1226.photobucket.com/albums/ee416/realodix/Photo%20Blog/description_zps8f9c858c.jpg
<?php
$id = $_GET['id'];
?>
<form id="form1" name="form1" method="post" enctype="multipart/form-data" action="wbpl_add-edit.php?action=updateproduct&id=<?php echo $id ?>">
<td>
<table>
<?php
$sql="select * from wbpl_product
where kd_product='$id'";
$result=mysql_query($sql) or die(mysql_error());
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td width="120">Deskription</td>
<td width="350">
<textarea name="product_deskripsi" rows="5" style="width: 512px;"><?php echo htmlspecialchars($rows['deskripsi']);?></textarea>
</td>
</tr>
<?php } ?>
<tr>
<td> </td>
<td>
<input class="btn" type="submit" name="tambah" value="Update" />
</td>
</tr>
<tr>
<td colspan='2'><div id="form1_errorloc" style="color:red"></div></td>
</tr>
</table></td>
</form>
你爲什麼要修剪的描述? –
@Daryl Gill 我試圖消除這些空間。看看這張圖片http://i1226.photobucket.com/albums/ee416/realodix/Photo%20Blog/description_zps8f9c858c.jpg –