Re: Parsing MySQL query return
| From: | Nicholas Robinson | Date: | Mon, 28 Jul 2003 22:38:46 +0000 |
| Subject: | Re: Parsing MySQL query return | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157252@lists.php.net to get a copy of this message | ||
It occurred to me after my first reply that you might be able to do something
in mysql.
This works (given my earlier assumptions):
select left( paras, if ( locate( '\n', paras ) = 0, length( paras ), locate(
'\n', paras ))) ...
It will work with \n\n as well.
N
On Monday 28 Jul 2003 7:57 pm, Ewout de Boer wrote:
> ----- Original Message -----
> From: "John" <jpoz@quickscribble.com>
> To: <php-general@lists.php.net>
> Sent: Monday, July 28, 2003 8:22 PM
> Subject: [PHP] Parsing MySQL query return
>
> > Hey All,
> >
> > I have a question regarding parsing text from a MySQL query. Basically, I
> > have several paragraphs of text in a field in MySQL. I run a query, get
>
> the
>
> > results, no problem. However, I would like to only display the first
> > paragraph of the data returned.
> >
> > What is the best way to do this?
>
> That depends on te format of the text/paragraphs in the mysql field.
> How are the paragraphs separated ?
>
>
>
> regards,
> Ewout