error_22
03-30-2006, 06:48 PM
I want to limit the numbers of characters, but i dont know how to do that. Can someone help me?
if ($show == "ad"){
$sql = "SELECT * FROM ads Where id='".$_GET[id]."'";
$result = mysql_query($sql) or die("SQL: $sql ".mysql_error());
while ($adsresult = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "$adsresult[fname] $adsresult[lname] <br>
<b>E-post:</b> $adsresult[email] <br>
<b>Kategori:</b> $adsresult[category] <br>
<b>Rubrik:</b> $adsresult[head] <br>
<b>Meddelande:</b> $adsresult[message] <br>
<b>Datum:</b> $adsresult[date] <br>";
}}
I want to limit the numbers of characters in just "$adsresult[message]" and also add "..." after, is that possible?
Thanks in advance
Niklas
if ($show == "ad"){
$sql = "SELECT * FROM ads Where id='".$_GET[id]."'";
$result = mysql_query($sql) or die("SQL: $sql ".mysql_error());
while ($adsresult = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "$adsresult[fname] $adsresult[lname] <br>
<b>E-post:</b> $adsresult[email] <br>
<b>Kategori:</b> $adsresult[category] <br>
<b>Rubrik:</b> $adsresult[head] <br>
<b>Meddelande:</b> $adsresult[message] <br>
<b>Datum:</b> $adsresult[date] <br>";
}}
I want to limit the numbers of characters in just "$adsresult[message]" and also add "..." after, is that possible?
Thanks in advance
Niklas