First 10 words of database entry how?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
cturner
Forum Contributor
Posts: 153
Joined: Sun Jul 16, 2006 3:03 am
Location: My computer

First 10 words of database entry how?

Post by cturner »

I am wondering if someone, could please tell me how I can display only the first 10 words of a database entry? Thanks in advance.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Hmm, I can't think of anyway to grab the first 10 words. You can use LEFT() to get the X amount of characters, or you can use php to perform the regex to capture the 10 words.

viewtopic.php?t=25351
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

SUBSTRING_INDEX()?
Post Reply