Re: check for \n
| From: | Vincent Vandemeulebrouck | Date: | Tue, 19 Nov 2002 01:07:02 +0000 |
| Subject: | Re: check for \n | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125010@lists.php.net to get a copy of this message | ||
> > $sql = 'SELECT id,ST FROM ccl.ccl_main';
> > ...
> > $news = mysql_query($sql);
> > while ($mydata = mysql_fetch_object($news))
> > {
> > if ???????$mydata->ST?????????
> > echo "$mydata->id - $mydata->ST<hr>";
> > }
>
> Use strstr() with "\n" as the needle. Check out the "String functions"
> chapter, lots more goodies there.
Or, try the following:
$sql = "SELECT id,ST FROM ccl.ccl_main where ST like '%s\n%s' ";
I am not 100% sure it will work with 'text' field, but it should.
Vincent Vandemeulebrouck