Is there an alternatiuve to substr,
My problem:
I need to extract only the first 30 words from my body column from my mysql database table, for displaying on my pagination page,
Liek these gys do it down teh center of there page:, and display ... after some text:
http://www.articlealley.com/
how can i do this with top performance, i ahev thousands of records, is substr the only way?
Thanks in advance
kind regards
Tovia Singer
Urgent:Is there alternative to substr?:
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
you do want substr(), just not PHP's substr()!
MySQL's SUBSTR()
http://dev.mysql.com/doc/refman/5.0/en/ ... _substring
Or, if you prefer the first so many words:
http://dev.mysql.com/doc/refman/5.0/en/ ... ring-index
MySQL's SUBSTR()
http://dev.mysql.com/doc/refman/5.0/en/ ... _substring
Or, if you prefer the first so many words:
http://dev.mysql.com/doc/refman/5.0/en/ ... ring-index
That's a very useful SQL function that I'd never noticed before! Thanks, Kieran.Kieran Huggins wrote:Or, if you prefer the first so many words:
http://dev.mysql.com/doc/refman/5.0/en/ ... ring-index
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA