Jump to content

Help with extraction


timmah1

Recommended Posts

I have a question on limiting content from the database.

 

It I have a database for blogs, and the only tables are

id

headline

blog

 

If the blog table has 500 words in it, how do I make the blog content limited to say only 50 words?

 

I want to list the blog headline and just a little bit of the content, and then have just a little bit of the blog with a read more... link.

 

How do I limit the blog?

 

thank you in advance

Link to comment
https://forums.phpfreaks.com/topic/81403-help-with-extraction/
Share on other sites

There is no way to specify the amount of characters to return from a field; however, you can manipulate the maximum amount of data that is allowed to be transfered. In doing so, you can limit the number of words returned. Like mgallforever stated, though, it is going to be a lot easier to let php handle it.

 

Here is info on max_allowed_packet:

http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

Link to comment
https://forums.phpfreaks.com/topic/81403-help-with-extraction/#findComment-413133
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.