You can use mysql substring(text, start, end) if you know how many characters to extract.
Code:
SELECT Substring(articletext, 0, 20) AS abstract FROM yourtable
WHERE authorid = 1
ORDER BY publisheddate
LIMIT 1;
You can also use PHPs function substr() and strpos() in connection to get the first paragraph.
Example:
PHP Code:
$text = '<p>blasdasdasdsad</p><p>asdsad</p>';
echo substr($text, 0, strpos('</p>', text));
Maybe you have to add the length of the search word (here </p>) to the number returned by strpos.
Christian
Bookmarks