timmah1 Posted December 12, 2007 Share Posted December 12, 2007 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 Quote Link to comment Share on other sites More sharing options...
marcus Posted December 12, 2007 Share Posted December 12, 2007 wordwrap and substr. Quote Link to comment Share on other sites More sharing options...
lemmin Posted December 12, 2007 Share Posted December 12, 2007 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 Quote Link to comment Share on other sites More sharing options...
timmah1 Posted December 13, 2007 Author Share Posted December 13, 2007 I understand how wordwrap works, but not to sure about substr Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.