toastyman said:Something like this?
Code:$count = count(explode(" ", $text)); if($count>=50) $text .= "... <a href="/article/321/">View full article</a>"; else $text .= " <a href="/article/321/">View article</a>"; echo $text;
SELECT
article_title AS title,
article_content AS content,
CONCAT(SUBSTRING_INDEX(article_content, ' ', 50)) AS excerpt
FROM
articles