RE: [PHP-DB] Re: Show abbreviated article
| From: | Jon Farmer | Date: | Mon, 13 Aug 2001 11:37:15 +0000 |
| Subject: | RE: [PHP-DB] Re: Show abbreviated article | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11284@lists.php.net to get a copy of this message | ||
NO! This will return the first 20 characters from the field not the first 20
words. To do that you need to use a regexp in the SQL or explode the result
in php and use the first 20 elements of the array!
Regards
Jon Farmer
Systems Programmer
Entanet International Ltd www.enta.net
Tel 01952 428969
Mob 07968 524175
-----Original Message-----
From: Johannes Janson [mailto:johannes.janson@gmx.de]
Sent: 13 August 2001 12:15
To: php-db@lists.php.net
Subject: [PHP-DB] Re: Show abbreviated article
hi,
[...]
> My question is this: how can I select only those first 20 words in the
> PHP code?
SELECT LEFT(YourBlobFiekd, 20) FROM YourTable;
hope it helps
Johannes
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net