1

ペットの遺失物ウェブサイトを運営していますが、迷子になったペットのリストに問題があります。

http://alphapets.co.nz/lost/lost.php

すべてのリストが同じサイズになり、テキストがオーバーフローしないように、説明に少数の単語のみを表示する方法がわかりません。

phpは以下です。

// Retrieves data from MySQL 
$data2 = mysql_query("SELECT * FROM pets WHERE status LIKE '".
                     $thisPage."' ORDER BY `pets`.`ID` DESC")
  or die(mysql_error());  //Puts it into an array 

while($info2 = mysql_fetch_array( $data2 )) { 
  //Outputs the image and other data
  echo "<div id='wrapper4'>
<div id='pet_profile_image'>
<img src=http://alphapets.co.nz/lost/petimages/resized_$info2[date]$info2[photo]
     class='mainimage'>
</div>

<div id='pet_description'>
  <h2><a href='/download.php?ID=$info2[ID]'>$info2[name]</a> </h2><br />
  <b>Location:</b> $info2[town], $info2[city]  <br />
  <b>Description</b>: $info2[description] <br /><br />
  <a href='/download.php?ID=$info2[ID]'>Click here for more</a>
</div>
</div>"; 
}
4

1 に答える 1

1

これは役立つかもしれません。

http://www.daniweb.com/web-development/php/threads/131085/how-to-display-part-of-text-from-msql

于 2012-05-06T01:10:13.020 に答える