check for \n
| From: | John Taylor-Johnston | Date: | Mon, 18 Nov 2002 19:37:16 +0000 |
| Subject: | check for \n | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-124966@lists.php.net to get a copy of this message | ||
Like I have a clue :)
I want to convert some fields from TEXT to VARCHAR(255).
(Going from a textarea to an input type=text)
I've checked the length of each $mydata->ST, so I won't be losing data.
What I am worried about is losing data if there are \n in any of the fields.
How do I check to see if a \n exists in $mydata->ST in my WHILE statement?
$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>";
}