How would one go about retrieving only a pratial amount of data stored in a field of a MySQL db table?
for example i query a field called 'w_f_content' which contains several rows of text. I only want to show say 15 words or lines of text or characters or whatever...
<?php
$wine_food_result = tep_db_query("select * from wine_food where w_f_id = $w_f_id");
while($row = mysql_fetch_array($wine_food_result)) {
$w_f_id=$row[0];
$w_f_content=$row[1];
}
?>
in this example <? echo "$w_f_content"; ?> would display all the text in the field but i wish to cut it off after 15 lines (words, etc)...
In other words the output would be something like: "This is a great choice for certain occasions depending on..."
where it would then stop the output.
So far I have concluded that I could use htmspecialchars() but I am not sure how to apply it.
Help is appreciated.